CAD Exchanger SDK
cadex::ModelData_BezierCurve Class Reference

Defines 3D Bezier curve. More...

Inheritance diagram for cadex::ModelData_BezierCurve:
cadex::ModelData_Curve

Public Member Functions

 ModelData_BezierCurve ()
 Constructor. More...
 
 ModelData_BezierCurve (const ModelData_Point thePoles[], int theNumberOfPoles)
 Constructor. More...
 
 ModelData_BezierCurve (const ModelData_Point thePoles[], const double thePoleWeights[], int theNumberOfPoles)
 Constructor. More...
 
 ModelData_BezierCurve (const Handle_C &)
 Constructor.
 
int Degree () const
 Returns degree. More...
 
int NumberOfPoles () const
 Returns number of poles. More...
 
ModelData_Point Pole (const int theIndex) const
 Returns a pole value. More...
 
int Poles (ModelData_Point thePoles[]) const
 Populates a vector of poles. More...
 
double Weight (const int theIndex) const
 Returns a weight value. More...
 
int Weights (double theWeights[]) const
 Populates a vector of weights. More...
 
 operator const Handle_C & () const
 Cast operator.
 
- Public Member Functions inherited from cadex::ModelData_Curve
 ModelData_Curve ()
 Constructor.
 
 ModelData_Curve (const ModelData_Curve &theOther)
 Constructor.
 
 ModelData_Curve (ModelData_Curve &&theOther)
 Constructor.
 
 ~ModelData_Curve ()
 Destructor.
 
ModelData_Curveoperator= (const ModelData_Curve &theOther)
 Assignment operator.
 
ModelData_Curveoperator= (ModelData_Curve &&theOther)
 Move assignment operator.
 
 operator const Handle_C & () const
 Cast operator.
 
ModelData_CurveType Type () const
 Returns a curve type.
 
bool IsNull () const
 Returns true if the object has not been initialized yet.
 
 operator bool () const
 Returns if the object has been initialized. More...
 
bool IsPeriodic () const
 Returns true if the curve is periodic.
 
double UMin () const
 Returns a minimum parameter of a definition domain. More...
 
double UMax () const
 Returns a maximum parameter of a definition domain. More...
 
void Domain (double &theUMin, double &theUMax) const
 Returns a definition domain. More...
 
ModelData_Point Value (double theParameter) const
 Evaluates a point on the curve. More...
 
ModelData_Curve Reversed () const
 Returns a curve with reversed orientation. More...
 
void Transform (const ModelData_Transformation &theTransformation)
 Applies transformation matrix to this object. More...
 
ModelData_Curve Transformed (const ModelData_Transformation &theTransformation) const
 Returns a copy this object after applying transformation. More...
 
ModelData_Continuity Continuity () const
 Returns a continuity type of the curve.
 
void D0 (double theParameter, ModelData_Point &theValue) const
 Returns the point theValue of parameter theParam. More...
 
void D1 (double theParameter, ModelData_Point &theValue, ModelData_Vector &theD1) const
 Returns the point theValue of parameter theParam and the first derivative theD1. More...
 
void D2 (double theParameter, ModelData_Point &theValue, ModelData_Vector &theD1, ModelData_Vector &theD2) const
 Returns the point theValue of parameter theParam and second derivatives theD1 and theD2. More...
 
bool DN (double theParameter, size_t theDerivativeOrder, ModelData_Point &theValue, ModelData_Vector theD[]) const
 
double Curvature (double theParameter) const
 Returns the curvature value of parameter theParam.
 
void Normal (double theParameter, ModelData_Direction &theNormal) const
 Returns the normal direction theNormal of parameter theParam.
 
void Mirror (const ModelData_Point &thePoint)
 Mirrors the curve relative to the point.
 
void Mirror (const ModelData_Axis1Placement &theAxis)
 Mirrors the curve relative to the axis placement.
 
void Mirror (const ModelData_Axis2Placement &theAxis)
 Mirrors the curve relative to the axis placement.
 
template<typename T >
ModelData_Curve Mirrored (const T &theRef) const
 Returns a copy this curve translated along the vector. More...
 
void Rotate (const ModelData_Axis1Placement &theAxis, double theAngle)
 Rotates the curve around the axis.
 
ModelData_Curve Rotated (const ModelData_Axis1Placement &theAxis, double theAngle)
 Returns a copy this curve rotated along the axis. More...
 
void Translate (const ModelData_Vector &theVector)
 Translates the curve along the vector.
 
ModelData_Curve Translated (const ModelData_Vector &theVector)
 Returns a copy this curve translated along the vector. More...
 
void Scale (const ModelData_Point &thePoint, double theScale)
 Scales the curve with respect to the point.
 
ModelData_Curve Scaled (const ModelData_Point &thePoint, double theScale)
 Returns a copy this curve scaled with respect to the point. More...
 

Additional Inherited Members

- Protected Member Functions inherited from cadex::ModelData_Curve
 ModelData_Curve (const Handle_C &, ModelData_CurveType)
 Constructor.
 
internal::ModelData_CurveImpl & Impl ()
 Returns internal implementation object.
 

Detailed Description

Defines 3D Bezier curve.

Bezier curve is defined by control points (poles) and their weights. The following image depicts an example of a Bezier curve:

bezier_curve.png
Bezier curve

For introduction to and mathematical definition of Bezier curve please refer to external resources, for instance:

A rational Bezier curve contains an explicit vector of weights, whereas polynomial does not.

The curve degree equals number of poles minus one. Degree up to 25 is supported.

The Bezier curve is always considered non-periodic.

Constructor & Destructor Documentation

◆ ModelData_BezierCurve() [1/3]

cadex::ModelData_BezierCurve::ModelData_BezierCurve ( )
inline

Constructor.

Empty constructor.

◆ ModelData_BezierCurve() [2/3]

cadex::ModelData_BezierCurve::ModelData_BezierCurve ( const ModelData_Point  thePoles[],
int  theNumberOfPoles 
)

Constructor.

Creates a polynomial Bezier curve.

theNumberOfPoles defines the length of thePoles and must belong to [2, 26]. Created curve has a degree equal to theNumberOfPoles - 1.

◆ ModelData_BezierCurve() [3/3]

cadex::ModelData_BezierCurve::ModelData_BezierCurve ( const ModelData_Point  thePoles[],
const double  thePoleWeights[],
int  theNumberOfPoles 
)

Constructor.

Creates a rational Bezier curve.

theNumberOfPoles defines the length of thePoles and thePoleWeights and must belong to [2, 26]. Created curve has a degree equal to theNumberOfPoles - 1.

Poles are to be provided after division by their weights.

Member Function Documentation

◆ Degree()

int cadex::ModelData_BezierCurve::Degree ( ) const

Returns degree.

Returns the value equal to NumberOfPoles() - 1.

◆ NumberOfPoles()

int cadex::ModelData_BezierCurve::NumberOfPoles ( ) const

Returns number of poles.

Returns the value specified in the constructor.

◆ Pole()

ModelData_Point cadex::ModelData_BezierCurve::Pole ( const int  theIndex) const

Returns a pole value.

theIndex must be in the range [1, NumberOfPoles()].

See also
Weight().

◆ Poles()

int cadex::ModelData_BezierCurve::Poles ( ModelData_Point  thePoles[]) const

Populates a vector of poles.

thePoles must point to a buffer in memory with at least NumberOfPoles() preallocated values.

Returns NumberOfPoles().

See also
Weights().

◆ Weight()

double cadex::ModelData_BezierCurve::Weight ( const int  theIndex) const

Returns a weight value.

theIndex must be in the range [1, NumberOfPoles()].

For polynomial Bezier behavior is undefined.

See also
Pole().

◆ Weights()

int cadex::ModelData_BezierCurve::Weights ( double  theWeights[]) const

Populates a vector of weights.

theWeights must point to a buffer in memory with at least NumberOfPoles() preallocated values.

Returns NumberOfPoles().

For polynomial Bezier does nothing and returns 0.

See also
Poles().