Loading...
Searching...
No Matches
GeomUtilSphereMeshGenerator Class Referencefinal

This class provides an implementation for generating topology and point positions on a sphere with a given radius. More...

#include <sphereMeshGenerator.h>

+ Inheritance diagram for GeomUtilSphereMeshGenerator:

Static Public Member Functions

static GEOMUTIL_API size_t ComputeNumPoints (const size_t numRadial, const size_t numAxial, const bool closedSweep=true)
 
static GEOMUTIL_API PxOsdMeshTopology GenerateTopology (const size_t numRadial, const size_t numAxial, 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 size_t numAxial, const ScalarType radius, 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 size_t numAxial, const ScalarType radius, const ScalarType sweepDegrees, const GfMatrix4d *framePtr=nullptr)
 
template<typename PointIterType , typename Enabled = typename _EnableIfNotGfVec3Iterator<PointIterType>::type>
static void GeneratePoints (PointIterType iter,...)
 
- Static Public Member Functions inherited from GeomUtilMeshGeneratorBase
template<typename PointIterType , typename Enabled = typename _EnableIfNotGfVec3Iterator<PointIterType>::type>
static void GeneratePoints (PointIterType iter,...)
 

Static Public Attributes

static constexpr size_t minNumRadial = 3
 
static constexpr size_t minNumAxial = 2
 

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)
 

Detailed Description

This class provides an implementation for generating topology and point positions on a sphere with a given radius.

The sphere is made up of circular cross-sections in the XY plane and is centered at the origin. Each cross-section has numRadial segments. Successive cross-sections are generated at numAxial locations along the Z axis, with the bottom of the sphere at Z = -r and top at Z = r.

An optional transform may be provided to GeneratePoints to orient the sphere as necessary (e.g., cross-sections in the YZ plane).

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

Usage:

const size_t numRadial = 4, numAxial = 4;
const size_t numPoints =
GeomUtilSphereMeshGenerator::ComputeNumPoints(numRadial, numAxial);
const float radius = 5;
MyPointContainer<GfVec3f> points(numPoints);
GeomUtilSphereMeshGenerator::GeneratePoints(
points.begin(), numRadial, numAxial, radius);

Definition at line 66 of file sphereMeshGenerator.h.

Member Function Documentation

◆ GeneratePoints() [1/3]

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

Definition at line 89 of file sphereMeshGenerator.h.

◆ GeneratePoints() [2/3]

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

Definition at line 104 of file sphereMeshGenerator.h.

◆ GeneratePoints() [3/3]

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

Definition at line 234 of file meshGeneratorBase.h.

Member Data Documentation

◆ minNumAxial

constexpr size_t minNumAxial = 2
staticconstexpr

Definition at line 71 of file sphereMeshGenerator.h.

◆ minNumRadial

constexpr size_t minNumRadial = 3
staticconstexpr

Definition at line 70 of file sphereMeshGenerator.h.


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