Loading...
Searching...
No Matches
GeomUtilConeMeshGenerator Class Referencefinal

This class provides an implementation for generating topology, point positions and surface normals on a cone of a given radius and height. More...

#include <coneMeshGenerator.h>

+ Inheritance diagram for GeomUtilConeMeshGenerator:

Static Public Member Functions

static GEOMUTIL_API size_t ComputeNumPoints (const size_t numRadial, const bool closedSweep=true)
 
static size_t ComputeNumNormals (const size_t numRadial, const bool closedSweep=true)
 
static TfToken GetNormalsInterpolation ()
 
static GEOMUTIL_API PxOsdMeshTopology GenerateTopology (const size_t numRadial, const bool closedSweep=true)
 
template<typename PointIterType , typename ScalarType , typename Enabled = typename _EnableIfGfVec3Iterator<PointIterType>::type>
static void GeneratePoints (PointIterType iter, const size_t numRadial, const ScalarType radius, const ScalarType height, const GfMatrix4d *framePtr=nullptr)
 
template<typename PointIterType , typename ScalarType , typename Enabled = typename _EnableIfGfVec3Iterator<PointIterType>::type>
static void GeneratePoints (PointIterType iter, const size_t numRadial, const ScalarType radius, const ScalarType height, const ScalarType sweepDegrees, const GfMatrix4d *framePtr=nullptr)
 
template<typename PointIterType , typename ScalarType , typename Enabled = typename _EnableIfGfVec3Iterator<PointIterType>::type>
static void GenerateNormals (PointIterType iter, const size_t numRadial, const ScalarType radius, const ScalarType height, const GfMatrix4d *framePtr=nullptr)
 
template<typename PointIterType , typename ScalarType , typename Enabled = typename _EnableIfGfVec3Iterator<PointIterType>::type>
static void GenerateNormals (PointIterType iter, const size_t numRadial, const ScalarType radius, const ScalarType height, const ScalarType sweepDegrees, const GfMatrix4d *framePtr=nullptr)
 
template<typename PointIterType , typename Enabled = typename _EnableIfNotGfVec3Iterator<PointIterType>::type>
static void GeneratePoints (PointIterType iter,...)
 
template<typename PointIterType , typename Enabled = typename _EnableIfNotGfVec3Iterator<PointIterType>::type>
static void GenerateNormals (PointIterType iter,...)
 
- Static Public Member Functions inherited from GeomUtilMeshGeneratorBase
template<typename PointIterType , typename Enabled = typename _EnableIfNotGfVec3Iterator<PointIterType>::type>
static void GeneratePoints (PointIterType iter,...)
 
template<typename PointIterType , typename Enabled = typename _EnableIfNotGfVec3Iterator<PointIterType>::type>
static void GenerateNormals (PointIterType iter,...)
 

Static Public Attributes

static constexpr size_t minNumRadial = 3
 

Additional Inherited Members

- Protected Types inherited from GeomUtilMeshGeneratorBase
enum  _CapStyle { CapStyleNone , CapStyleSharedEdge , CapStyleSeparateEdge }
 
- Static Protected Member Functions inherited from GeomUtilMeshGeneratorBase
static PxOsdMeshTopology _GenerateCappedQuadTopology (const size_t numRadial, const size_t numQuadStrips, const _CapStyle bottomCapStyle, const _CapStyle topCapStyle, const bool closedSweep)
 
static size_t _ComputeNumRadialPoints (const size_t numRadial, const bool closedSweep)
 
static size_t _ComputeNumCappedQuadTopologyPoints (const size_t numRadial, const size_t numQuadStrips, const _CapStyle bottomCapStyle, const _CapStyle topCapStyle, const bool closedSweep)
 
template<typename ScalarType >
static std::vector< std::array< ScalarType, 2 > > _GenerateUnitArcXY (const size_t numRadial, const ScalarType sweepDegrees)
 

Detailed Description

This class provides an implementation for generating topology, point positions and surface normals on a cone of a given radius and height.

The cone is made up of circular cross-sections in the XY plane and is centered at the origin. Each cross-section has numRadial segments. The height is aligned with the Z axis, with the base of the object at Z = -h/2 and apex at Z = h/2.

An optional transform may be provided to GeneratePoints and GenerateNormals to orient the cone as necessary (e.g., whose height is aligned with the Y axis).

An additional overload of GeneratePoints is provided to specify the sweep angle for the cone about the +Z axis. When the sweep is less than 360 degrees, the generated geometry is not closed.

Usage:

const size_t numRadial = 8;
const size_t numPoints =
GeomUtilConeMeshGenerator::ComputeNumPoints(numRadial);
const float radius = 1, height = 2;
MyPointContainer<GfVec3f> points(numPoints);
GeomUtilConeMeshGenerator::GeneratePoints(
points.begin(), numRadial, radius, height);
const size_t numNormals =
GeomUtilConeMeshGenerator::ComputeNumNormals(numRadial);
MyPointContainer<GfVec3f> normals(numNormals);
GeomUtilConeMeshGenerator::GenerateNormals(
normals.begin(), numRadial, radius, height);

Definition at line 59 of file coneMeshGenerator.h.

Member Function Documentation

◆ ComputeNumNormals()

static size_t ComputeNumNormals ( const size_t  numRadial,
const bool  closedSweep = true 
)
inlinestatic

Definition at line 70 of file coneMeshGenerator.h.

◆ GenerateNormals() [1/3]

static void GenerateNormals ( PointIterType  iter,
const size_t  numRadial,
const ScalarType  radius,
const ScalarType  height,
const GfMatrix4d framePtr = nullptr 
)
inlinestatic

Definition at line 130 of file coneMeshGenerator.h.

◆ GenerateNormals() [2/3]

static void GenerateNormals ( PointIterType  iter,
const size_t  numRadial,
const ScalarType  radius,
const ScalarType  height,
const ScalarType  sweepDegrees,
const GfMatrix4d framePtr = nullptr 
)
inlinestatic

Definition at line 145 of file coneMeshGenerator.h.

◆ GenerateNormals() [3/3]

static void GenerateNormals ( PointIterType  iter,
  ... 
)
inlinestatic

Definition at line 326 of file meshGeneratorBase.h.

◆ GeneratePoints() [1/3]

static void GeneratePoints ( PointIterType  iter,
const size_t  numRadial,
const ScalarType  radius,
const ScalarType  height,
const GfMatrix4d framePtr = nullptr 
)
inlinestatic

Definition at line 93 of file coneMeshGenerator.h.

◆ GeneratePoints() [2/3]

static void GeneratePoints ( PointIterType  iter,
const size_t  numRadial,
const ScalarType  radius,
const ScalarType  height,
const ScalarType  sweepDegrees,
const GfMatrix4d framePtr = nullptr 
)
inlinestatic

Definition at line 108 of file coneMeshGenerator.h.

◆ GeneratePoints() [3/3]

static void GeneratePoints ( PointIterType  iter,
  ... 
)
inlinestatic

Definition at line 308 of file meshGeneratorBase.h.

◆ GetNormalsInterpolation()

static TfToken GetNormalsInterpolation ( )
inlinestatic

Definition at line 78 of file coneMeshGenerator.h.

Member Data Documentation

◆ minNumRadial

constexpr size_t minNumRadial = 3
staticconstexpr

Definition at line 63 of file coneMeshGenerator.h.


The documentation for this class was generated from the following file: