Hide menu
cadex::ModelAlgo_BSplineConverter Class Reference

Converts geometrical entities into B-Spline representation. More...

Public Types

typedef ModelAlgo_BSplineConverterParameters ParametersType
 Defines a converter parameters type.

Public Member Functions

 ModelAlgo_BSplineConverter ()
 Constructor. More...
 ModelAlgo_BSplineConverter (const ParametersType &theParameters)
 Constructor. More...
const ParametersTypeParameters () const
 Returns parameters.
ParametersTypeParameters ()
 Returns parameters.
void SetParameters (const ParametersType &theParameters)
 Sets parameters.
void Perform (const ModelData_Model &theModel) const
 Applies conversion to entire model.
void Perform (const ModelData_SceneGraphElement &theElement) const
 Applies conversion to a sub-tree.
ModelData_Shape Perform (const ModelData_Shape &theShape) const
 Applies conversion to a shape.
const std::shared_ptr< internal::ModelAlgo_BSplineConverterImpl > & Impl () const
 Returns an implementation object.

Protected Attributes

std::shared_ptr< internal::ModelAlgo_BSplineConverterImpl > myImpl
 Internal implementation object.

Detailed Description

Converts geometrical entities into B-Spline representation.

Converts geometrical entities (surfaces, 3D curves and 2D curves) into NURBS (Non-Uniform Rational B-Spline) representation.

Conversion can be applied to entire model (ModelData_Model), any sub-tree in the scene graph (i.e. sub-assembly or part) or any particular shape (ModelData_Shape). When applied to entire model or a sub-tree traverses parts' B-Rep representations.

Conversion can be parametrized and constrained with the help of ModelAlgo_BSplineConverterParameters. Conversion first aims to satisfy the tolerance requirement, then the maximum degree and number of spans (number of unique knots - 1 for non-periodic B-Splines, same as the number of unique knots for periodic ones). When the degree and number of spans constraints can't be satisfied at once, the one specified as priority constraint (see ModelAlgo_BSplineConverterParameters::PriorityConstraint()) is respected.

If any particular geometry (a surface or a curve) is already of NURBS representation then skips it unless it exceeds the maximum degree or span count requirements (see ModelAlgo_BSplineConverterParameters::MaxDegree() and ModelAlgo_BSplineConverterParameters::MaxNumOfSpans()).

Example (applying to entire model):

ModelData_Model aModel = ...;
aConverter.Parameters().ProcessCurves2d() = false; //ignore p-curves
aConverter.Perform (aModel);

Example (applying to a particular shape):

ModelData_Shape aShape = ...;
aConverter.Parameters().SetMaxDegree (6);
ModelData_Shape aNewShape = aConverter.Perform (aShape);

Constructor & Destructor Documentation

◆ ModelAlgo_BSplineConverter() [1/2]

cadex::ModelAlgo_BSplineConverter::ModelAlgo_BSplineConverter ( )


Creates a converter with default parameters.

See also

◆ ModelAlgo_BSplineConverter() [2/2]

cadex::ModelAlgo_BSplineConverter::ModelAlgo_BSplineConverter ( const ParametersType theParameters)


Creates a converter with specified parameters.

See also
Definition: ModelAlgo_BSplineConverter.cxx:186