Hide menu
Loading...
Searching...
No Matches
cadex::ModelAlgo_TopoPrimitives Class Reference

Creates B-Rep solid primitives. More...

Static Public Member Functions

static ModelData_Solid CreateBox (double theDx, double theDy, double theDz)
 Creates a box.
 
static ModelData_Solid CreateBox (const ModelData_Point &theMinPoint, double theDx, double theDy, double theDz)
 Creates a box.
 
static ModelData_Solid CreateBox (const ModelData_Point &theMinPoint, const ModelData_Point &theMaxPoint)
 Creates a box.
 
static ModelData_Solid CreateBox (const ModelData_Axis2Placement &theAxis, double theDx, double theDy, double theDz)
 Creates a box.
 
static ModelData_Solid CreateSphere (double theRadius, double theU=2 *M_PI, double theVmin=-M_PI_2, double theVmax=M_PI_2)
 Creates a sphere.
 
static ModelData_Solid CreateSphere (const ModelData_Point &theCenter, double theRadius, double theU=2 *M_PI, double theVmin=-M_PI_2, double theVmax=M_PI_2)
 Creates a sphere.
 
static ModelData_Solid CreateSphere (const ModelData_Axis2Placement &theAxis, double theRadius, double theU=2 *M_PI, double theVmin=-M_PI_2, double theVmax=M_PI_2)
 Creates a sphere.
 
static ModelData_Solid CreateCylinder (double theRadius, double theHeight, double theAngle=2 *M_PI)
 Creates a cylinder.
 
static ModelData_Solid CreateCylinder (const ModelData_Axis2Placement &theAxis, double theRadius, double theHeight, double theAngle=2 *M_PI)
 Creates a cylinder.
 
static ModelData_Solid CreateCone (double theRadius1, double theRadius2, double theHeight, double theAngle=2 *M_PI)
 Creates a cone.
 
static ModelData_Solid CreateCone (const ModelData_Axis2Placement &theAxis, double theRadius1, double theRadius2, double theHeight, double theAngle=2 *M_PI)
 Creates a cone.
 
static ModelData_Solid CreateTorus (double theRadius1, double theRadius2, double theU=2 *M_PI, double theVmin=0., double theVmax=2 *M_PI)
 Creates a torus.
 
static ModelData_Solid CreateTorus (const ModelData_Axis2Placement &theAxis, double theRadius1, double theRadius2, double theU=2 *M_PI, double theVmin=0., double theVmax=2 *M_PI)
 Creates a torus.
 

Detailed Description

Creates B-Rep solid primitives.

The ModelAlgo_TopoPrimitives class provides static methods to construct 3D topological solid primitives. Created primitives can be either complete or truncated. For instance, a sphere can be created either as a full sphere or bounded by its angles along U and V directions.

The following table demonstrates supported primitives:

CreateBox()
Box
CreateSphere()
Sphere
td
CreateCylinder()
Sphere
td
CreateCone()
Sphere
td
CreateTorus()
Sphere
td
See also
Assembly Modeling Example, ModelAlgo_BRepFeatures.
Examples
exploring/validationproperties/Program.cs, meshing/lods/Program.cs, modeling/brep/Program.cs, modeling/brepprimitives/Program.cs, and modeling/metadata/Program.cs.

Member Function Documentation

◆ CreateBox() [1/4]

ModelData_Solid cadex::ModelAlgo_TopoPrimitives::CreateBox ( const ModelData_Axis2Placement theAxis,
double  theDx,
double  theDy,
double  theDz 
)
static

Creates a box.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Creates a box with a corner at origin of theAxis, sides parallel to it and sizes theDx, theDy, theDz.

◆ CreateBox() [2/4]

ModelData_Solid cadex::ModelAlgo_TopoPrimitives::CreateBox ( const ModelData_Point theMinPoint,
const ModelData_Point theMaxPoint 
)
static

Creates a box.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Creates a box with corners theMinPoint, theMaxPoint.

◆ CreateBox() [3/4]

ModelData_Solid cadex::ModelAlgo_TopoPrimitives::CreateBox ( const ModelData_Point theMinPoint,
double  theDx,
double  theDy,
double  theDz 
)
static

Creates a box.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Creates a box with a corner at theMinPoint and sizes theDx, theDy, theDz.

The box sides are parallel to the axis of the global coordinate system.

◆ CreateBox() [4/4]

ModelData_Solid cadex::ModelAlgo_TopoPrimitives::CreateBox ( double  theDx,
double  theDy,
double  theDz 
)
static

Creates a box.

Creates a box with a corner at (0,0,0) and sizes theDx, theDy, theDz.

The box sides are parallel to the axis of the global coordinate system.

Examples
modeling/brep/Program.cs, modeling/brepprimitives/Program.cs, and modeling/metadata/Program.cs.

◆ CreateCone() [1/2]

ModelData_Solid cadex::ModelAlgo_TopoPrimitives::CreateCone ( const ModelData_Axis2Placement theAxis,
double  theRadius1,
double  theRadius2,
double  theHeight,
double  theAngle = 2 * M_PI 
)
static

Creates a cone.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Creates a cone located in the origin of a local coordinate system theAxis. Parametrization is along the axes of theAxis and use of parameters is the same as in the first CreateCone() overload.

◆ CreateCone() [2/2]

ModelData_Solid cadex::ModelAlgo_TopoPrimitives::CreateCone ( double  theRadius1,
double  theRadius2,
double  theHeight,
double  theAngle = 2 * M_PI 
)
static

Creates a cone.

Creates a cone located in the origin of a global coordinate system, with theRadius1 and theRadius2, theHeight and parametrized along axes of the global coordinate system.

If theAngle is specified then it defines trimming the cone along the angle of rotation. theAngle must be in the range (0, 2 * PI].

A full cone is created if theAngle use its default value.

Examples
modeling/brepprimitives/Program.cs.

◆ CreateCylinder() [1/2]

ModelData_Solid cadex::ModelAlgo_TopoPrimitives::CreateCylinder ( const ModelData_Axis2Placement theAxis,
double  theRadius,
double  theHeight,
double  theAngle = 2 * M_PI 
)
static

Creates a cylinder.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Creates a cylinder located in the origin of a local coordinate system theAxis. Parametrization is along the axes of theAxis and use of parameters is the same as in the first CreateCylinder() overload.

◆ CreateCylinder() [2/2]

ModelData_Solid cadex::ModelAlgo_TopoPrimitives::CreateCylinder ( double  theRadius,
double  theHeight,
double  theAngle = 2 * M_PI 
)
static

Creates a cylinder.

Creates a cylinder located in the origin of a global coordinate system, with theRadius, theHeight and parametrized along axes of the global coordinate system.

If theAngle is specified then it defines trimming the cylinder along the angle of rotation. theAngle must be in the range (0, 2 * PI].

A full cylinder is created if theAngle use its default value.

Examples
exploring/validationproperties/Program.cs, and modeling/brepprimitives/Program.cs.

◆ CreateSphere() [1/3]

ModelData_Solid cadex::ModelAlgo_TopoPrimitives::CreateSphere ( const ModelData_Axis2Placement theAxis,
double  theRadius,
double  theU = 2 * M_PI,
double  theVmin = -M_PI_2,
double  theVmax = M_PI_2 
)
static

Creates a sphere.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Creates a sphere located in the origin of the theAxis. Parametrization is along the axes of theAxis and use of parameters is the same as in the first CreateSphere() overload.

◆ CreateSphere() [2/3]

ModelData_Solid cadex::ModelAlgo_TopoPrimitives::CreateSphere ( const ModelData_Point theCenter,
double  theRadius,
double  theU = 2 * M_PI,
double  theVmin = -M_PI_2,
double  theVmax = M_PI_2 
)
static

Creates a sphere.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Creates a sphere located in theCenter. Parametrization and use of parameters is the same as in the first CreateSphere() overload.

◆ CreateSphere() [3/3]

ModelData_Solid cadex::ModelAlgo_TopoPrimitives::CreateSphere ( double  theRadius,
double  theU = 2 * M_PI,
double  theVmin = -M_PI_2,
double  theVmax = M_PI_2 
)
static

Creates a sphere.

Creates a sphere located in the origin of a global coordinate system, with theRadius and parametrized along axes of the global coordinate system.

If the parameters theU, theVmin and theVmax are defined they define trimming the sphere as follows:

  • theU limits the sphere along the meridian angle. theU must be in the range (0, 2 * PI];
  • theVmin and theVmax limit the sphere along the parallels. theVmin must be in the range [-PI / 2, theVmax) and theVmax must be in the range (theVmin, PI / 2];

A full sphere is created if the angular parameters use their default values.

Examples
meshing/lods/Program.cs, and modeling/brepprimitives/Program.cs.

◆ CreateTorus() [1/2]

ModelData_Solid cadex::ModelAlgo_TopoPrimitives::CreateTorus ( const ModelData_Axis2Placement theAxis,
double  theRadius1,
double  theRadius2,
double  theU = 2 * M_PI,
double  theVmin = 0.,
double  theVmax = 2 * M_PI 
)
static

Creates a torus.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Creates a torus located in the origin of a local coordinate system theAxis. Parametrization is along the axes of theAxis and use of parameters is the same as in the first CreateTorus() overload.

◆ CreateTorus() [2/2]

ModelData_Solid cadex::ModelAlgo_TopoPrimitives::CreateTorus ( double  theRadius1,
double  theRadius2,
double  theU = 2 * M_PI,
double  theVmin = 0.,
double  theVmax = 2 * M_PI 
)
static

Creates a torus.

Creates a torus located in the origin of a global coordinate system, with major radius theRadius1, minor radius theRadius2, parametrized along axes of the global coordinate system.

If the parameters theU, theVmin and theVmax are defined they define trimming the torus as follows:

  • theU limits the torus along the rotation angle along the Z axis with major radius. theU must be in the range (0, 2 * PI];
  • theVmin and theVmax limit the torus along the rotation with minor raidus. theVmin must be in the range [0, theVmax) and theVmax must be in the range (theVmin, 2 * PI];

A full sphere is created if the angular parameters use their default values.

Examples
modeling/brepprimitives/Program.cs.