CAD Exchanger SDK
cadex::ModelData_BezierSurface Class Reference

Defines a Bezier surface. More...

Inheritance diagram for cadex::ModelData_BezierSurface:
cadex::ModelData_Surface

Public Member Functions

 ModelData_BezierSurface ()
 Constructor. More...
 
 ModelData_BezierSurface (const ModelData_Point thePoles[], int theNumberOfUPoles, int theNumberOfVPoles)
 Constructor. More...
 
 ModelData_BezierSurface (const ModelData_Point thePoles[], const double thePoleWeights[], int theNumberOfUPoles, int theNumberOfVPoles)
 Constructor. More...
 
 ModelData_BezierSurface (const Handle_C &)
 Constructor.
 
int UDegree () const
 Returns degree. More...
 
int VDegree () const
 Returns degree. More...
 
int NumberOfUPoles () const
 Returns number of U-poles. More...
 
int NumberOfVPoles () const
 Returns number of V-poles. More...
 
ModelData_Point Pole (const int theUIndex, const int theVIndex) const
 Returns a pole value. More...
 
int Poles (ModelData_Point thePoles[]) const
 Populates a 2D table of poles. More...
 
double Weight (const int theUIndex, const int theVIndex) const
 Returns a weight value. More...
 
int Weights (double theWeights[]) const
 Populates a 2D table of weights. More...
 
 operator const Handle_C & () const
 Cast operator.
 
- Public Member Functions inherited from cadex::ModelData_Surface
 ModelData_Surface ()
 Constructor.
 
 ModelData_Surface (const ModelData_Surface &theOther)
 Constructor.
 
 ModelData_Surface (ModelData_Surface &&theOther)
 Constructor.
 
 ~ModelData_Surface ()
 Destructor.
 
ModelData_Surfaceoperator= (const ModelData_Surface &theOther)
 Assignment operator.
 
ModelData_Surfaceoperator= (ModelData_Surface &&theOther)
 Move assignment operator.
 
 operator const Handle_C & () const
 Cast operator.
 
ModelData_SurfaceType Type () const
 Returns a surface type.
 
bool IsNull () const
 Returns true if the object has not been initialized yet.
 
 operator bool () const
 
bool IsUPeriodic () const
 Returns true if the surface is periodic in U direction. More...
 
bool IsVPeriodic () const
 Returns true if the surface is periodic in V direction. More...
 
double UMin () const
 Returns a minimum parameter of a definition domain in U direction. More...
 
double UMax () const
 Returns a maximum parameter of a definition domain in U direction. More...
 
double VMin () const
 Returns a minimum parameter of a definition domain in V direction. More...
 
double VMax () const
 Returns a maximum parameter of a definition domain in V direction. More...
 
void Domain (double &theUMin, double &theUMax, double &theVMin, double &theVMax) const
 Returns a definition domain. More...
 
ModelData_Point Value (double theParameterU, double theParameterV) const
 Evaluates a point on the surface. More...
 
void Transform (const ModelData_Transformation &theTransformation)
 Applies transformation matrix to this object. More...
 
ModelData_Surface 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 surface.
 
void D0 (double theParameterU, double theParameterV, ModelData_Point &theValue) const
 Returns the point theValue of parameter theU, theV on the surface. More...
 
void D1 (double theParameterU, double theParameterV, ModelData_Point &theValue, ModelData_Vector &theD1U, ModelData_Vector &theD1V) const
 Returns the point theValue and the first derivatives in the directions U theD1U and V theD1V at this point. More...
 
void D2 (double theParameterU, double theParameterV, ModelData_Point &theValue, ModelData_Vector &theD1U, ModelData_Vector &theD1V, ModelData_Vector &theD2U, ModelData_Vector &theD2V, ModelData_Vector &theD2UV) const
 Returns the point theValue, the first and the second derivatives in the directions U and V at this point. More...
 
bool DN (double theParameterU, double theParameterV, size_t theDerivativeOrder, ModelData_Point &theValue, ModelData_Vector theD[]) const
 
void Curvature (double theParameterU, double theParameterV, ModelData_Vector &thePrincipalMaxDirection, ModelData_Vector &thePrincipalMinDirection) const
 Returns the max and min principal curvature directions multiplied by max and min value of curvature respectively.
 
void Curvature (double theParameterU, double theParameterV, ModelData_Direction &thePrincipalMaxDirection, ModelData_Direction &thePrincipalMinDirection, double &theMaxCurvature, double &theMinCurvature) const
 Returns the max and min principal curvature directions and their values.
 
void Normal (double theParameterU, double theParameterV, ModelData_Direction &theNormal) const
 Returns the normal direction theNormal at the current point.
 
void Mirror (const ModelData_Point &thePoint)
 Mirrors the surface relative to the point.
 
void Mirror (const ModelData_Axis1Placement &theAxis)
 Mirrors the surface relative to the axis placement.
 
void Mirror (const ModelData_Axis2Placement &theAxis)
 Mirrors the surface relative to the axis placement.
 
template<typename T >
ModelData_Surface Mirrored (const T &theRef) const
 
void Rotate (const ModelData_Axis1Placement &theAxis, double theAngle)
 Rotates the surface around the axis.
 
ModelData_Surface Rotated (const ModelData_Axis1Placement &theAxis, double theAngle)
 
void Translate (const ModelData_Vector &theVector)
 Translates the surface along the vector.
 
ModelData_Surface Translated (const ModelData_Vector &theVector)
 
void Scale (const ModelData_Point &thePoint, double theScale)
 Scales the surface with respect to the point.
 
ModelData_Surface Scaled (const ModelData_Point &thePoint, double theScale)
 

Additional Inherited Members

- Protected Member Functions inherited from cadex::ModelData_Surface
 ModelData_Surface (const Handle_C &, ModelData_SurfaceType)
 Constructor.
 
internal::ModelData_SurfaceImpl & Impl ()
 Returns internal implementation object.
 

Detailed Description

Defines a Bezier surface.

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

bezier_surface.png
Bezier surface

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

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

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

The Bezier surface is always considered non-periodic.

Constructor & Destructor Documentation

◆ ModelData_BezierSurface() [1/3]

cadex::ModelData_BezierSurface::ModelData_BezierSurface ( )
inline

Constructor.

Empty constructor.

◆ ModelData_BezierSurface() [2/3]

cadex::ModelData_BezierSurface::ModelData_BezierSurface ( const ModelData_Point  thePoles[],
int  theNumberOfUPoles,
int  theNumberOfVPoles 
)

Constructor.

Creates a polynomial Bezier surface.

thePoles contains a 2D table of poles, with size equal to theNumberOfUPoles * theNumberOfVPoles. theNumberOfUPoles and theNumberOfVPoles must be >=2 each.

◆ ModelData_BezierSurface() [3/3]

cadex::ModelData_BezierSurface::ModelData_BezierSurface ( const ModelData_Point  thePoles[],
const double  thePoleWeights[],
int  theNumberOfUPoles,
int  theNumberOfVPoles 
)

Constructor.

Creates a rational Bezier surface.

thePoles contains a 2D table of poles, with size equal to theNumberOfUPoles * theNumberOfVPoles. theNumberOfUPoles and theNumberOfVPoles must be >=2 each.

thePoleWeights defines pole weights and must have the same size and layout as thePoles;

Member Function Documentation

◆ NumberOfUPoles()

int cadex::ModelData_BezierSurface::NumberOfUPoles ( ) const

Returns number of U-poles.

Returns the value specified in the constructor.

◆ NumberOfVPoles()

int cadex::ModelData_BezierSurface::NumberOfVPoles ( ) const

Returns number of V-poles.

Returns the value specified in the constructor.

◆ Pole()

ModelData_Point cadex::ModelData_BezierSurface::Pole ( const int  theUIndex,
const int  theVIndex 
) const

Returns a pole value.

theUIndex must be in the range [1, NumberOfUPoles()], theVIndex in the range [1, NumberOfVPoles()].

See also
Weight().

◆ Poles()

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

Populates a 2D table of poles.

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

Returns NumberOfUPoles() * NumberOfVPoles().

See also
Weights().

◆ UDegree()

int cadex::ModelData_BezierSurface::UDegree ( ) const

Returns degree.

Returns the value equal to NumberOfUPoles() - 1.

◆ VDegree()

int cadex::ModelData_BezierSurface::VDegree ( ) const

Returns degree.

Returns the value equal to NumberOfVPoles() - 1.

◆ Weight()

double cadex::ModelData_BezierSurface::Weight ( const int  theUIndex,
const int  theVIndex 
) const

Returns a weight value.

theUIndex must be in the range [1, NumberOfUPoles()], theVIndex in the range [1, NumberOfVPoles()].

For polynomial Bezier surface behavior is undefined.

See also
Pole().

◆ Weights()

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

Populates a 2D table of weights.

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

Returns NumberOfUPoles() * NumberOfVPoles().

See also
Weights().