Hide menu
Loading...
Searching...
No Matches
cadex::Geom::BezierSurface Class Reference

Defines a Bezier surface. More...

#include <cadex/Geom/BezierSurface.hxx>

Inheritance diagram for cadex::Geom::BezierSurface:
cadex::Geom::Surface cadex::Geom::Geometry cadex::BaseObject

Public Member Functions

 BezierSurface ()
 Constructor.
 
 BezierSurface (const std::vector< Point > &thePoles, int theNumberOfUPoles, int theNumberOfVPoles)
 Constructor.
 
 BezierSurface (const std::vector< Point > &thePoles, const std::vector< double > &thePoleWeights, int theNumberOfUPoles, int theNumberOfVPoles)
 Constructor.
 
int UDegree () const
 Returns degree.
 
int VDegree () const
 Returns degree.
 
int NumberOfUPoles () const
 Returns number of U-poles.
 
int NumberOfVPoles () const
 Returns number of V-poles.
 
Point Pole (int theUIndex, int theVIndex) const
 Returns a pole value.
 
std::vector< PointPoles () const
 Populates a 2D table of poles.
 
double Weight (int theUIndex, int theVIndex) const
 Returns a weight value.
 
std::vector< double > Weights () const
 Populates a 2D table of weights.
 
- Public Member Functions inherited from cadex::Geom::Surface
 Surface ()
 Constructor.
 
SurfaceType Type () const
 Returns a surface type.
 
Geom::Continuity Continuity () const
 Returns a continuity type of the surface.
 
Point Value (double theParameterU, double theParameterV) const
 Evaluates a point on the surface.
 
Direction Normal (double theParameterU, double theParameterV) const
 Returns the normal direction theNormal at the current point.
 
bool IsUPeriodic () const
 Returns true if the surface is periodic in U direction.
 
bool IsVPeriodic () const
 Returns true if the surface is periodic in V direction.
 
double UMin () const
 Returns a minimum parameter of a definition domain in U direction.
 
double UMax () const
 Returns a maximum parameter of a definition domain in U direction.
 
double VMin () const
 Returns a minimum parameter of a definition domain in V direction.
 
double VMax () const
 Returns a maximum parameter of a definition domain in V direction.
 
void Domain (double &theUMin, double &theUMax, double &theVMin, double &theVMax) const
 Returns a definition domain.
 
bool IsTrimmed () const
 Returns whether surface is trimmed or not.
 
void SetTrim (double theUFirst, double theULast, double theVFirst, double theVLast)
 Trims surface with [theUFirst, theULast] x [theVFirst, theVLast] section.
 
void Transform (const Transformation &theTransformation)
 Applies transformation matrix to this object.
 
Surface Transformed (const Transformation &theTransformation) const
 Returns a copy this object after applying transformation.
 
void D0 (double theParameterU, double theParameterV, Point &theValue) const
 Returns the point theValue of parameter theU, theV on the surface.
 
void D1 (double theParameterU, double theParameterV, Point &theValue, Vector &theD1U, Vector &theD1V) const
 Returns the point theValue and the first derivatives in the directions U theD1U and V theD1V at this point.
 
void D2 (double theParameterU, double theParameterV, Point &theValue, Vector &theD1U, Vector &theD1V, Vector &theD2U, Vector &theD2V, Vector &theD2UV) const
 Returns the point theValue, the first and the second derivatives in the directions U and V at this point.
 
bool DN (double theParameterU, double theParameterV, size_t theDerivativeOrder, Geom::Point &theValue, std::vector< Geom::Vector > &theD) const
 
void Curvature (double theParameterU, double theParameterV, Direction &thePrincipalMaxDirection, Direction &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, Direction &thePrincipalMaxDirection, Direction &thePrincipalMinDirection, double &theMaxCurvature, double &theMinCurvature) const
 Returns the max and min principal curvature directions and their values.
 
void Mirror (const Point &thePoint)
 
void Mirror (const Axis1d &theAxis)
 
void Mirror (const Axis3d &theAxis)
 
Surface Mirrored (const Point &theRef) const
 
Surface Mirrored (const Axis1d &theAxis) const
 
Surface Mirrored (const Axis3d &theAxis) const
 
void Rotate (const Axis1d &theAxis, double theAngle)
 
Surface Rotated (const Axis1d &theAxis, double theAngle) const
 
void Translate (const Vector &theVector)
 
Surface Translated (const Vector &theVector) const
 
void Scale (const Point &thePoint, double theScale)
 
Surface Scaled (const Point &thePoint, double theScale) const
 
- Public Member Functions inherited from cadex::BaseObject
size_t Id () const
 Return unique identifier of public object.
 
internal::BaseObjectImpl * Impl () const
 
bool IsNull () const
 
 operator bool () const
 
template<typename T >
bool IsOfType () const
 
template<typename T >
T * Impl () const
 Reserved for internal use.
 

Static Public Member Functions

static bool CompareType (const BaseObject &theObject)
 
- Static Public Member Functions inherited from cadex::Geom::Surface
static bool CompareType (const BaseObject &theObject)
 
- Static Public Member Functions inherited from cadex::Geom::Geometry
static bool CompareType (const BaseObject &theObject)
 

Additional Inherited Members

- Public Types inherited from cadex::BaseObject
typedef std::shared_ptr< internal::BaseObjectImpl > ImplType
 
- Protected Member Functions inherited from cadex::Geom::Surface
 Surface (const ImplType &theImpl)
 
- Protected Member Functions inherited from cadex::Geom::Geometry
 Geometry (const ImplType &theImpl)
 
- Protected Member Functions inherited from cadex::BaseObject
 BaseObject (const ImplType &theImpl)
 

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

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

◆ BezierSurface() [1/2]

cadex::Geom::BezierSurface::BezierSurface ( const std::vector< 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.

◆ BezierSurface() [2/2]

cadex::Geom::BezierSurface::BezierSurface ( const std::vector< Point > & thePoles,
const std::vector< double > & theWeights,
int theNumOfUPoles,
int theNumOfVPoles )

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::Geom::BezierSurface::NumberOfUPoles ( ) const

Returns number of U-poles.

Returns the value specified in the constructor.

◆ NumberOfVPoles()

int cadex::Geom::BezierSurface::NumberOfVPoles ( ) const

Returns number of V-poles.

Returns the value specified in the constructor.

◆ Pole()

Point cadex::Geom::BezierSurface::Pole ( int theUIndex,
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()

std::vector< Point > cadex::Geom::BezierSurface::Poles ( ) 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::Geom::BezierSurface::UDegree ( ) const

Returns degree.

Returns the value equal to NumberOfUPoles() - 1.

◆ VDegree()

int cadex::Geom::BezierSurface::VDegree ( ) const

Returns degree.

Returns the value equal to NumberOfVPoles() - 1.

◆ Weight()

double cadex::Geom::BezierSurface::Weight ( int theUIndex,
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()

std::vector< double > cadex::Geom::BezierSurface::Weights ( ) 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().