Defines 3D Bezier curve. More...
#include <cadex/Geom/BezierCurve.hxx>
Public Member Functions | |
BezierCurve () | |
Constructor. | |
BezierCurve (const std::vector< Point > &thePoles) | |
Constructor. | |
BezierCurve (const std::vector< Point > &thePoles, const std::vector< double > &thePoleWeights) | |
Constructor. | |
int | Degree () const |
Returns degree. | |
int | NumberOfPoles () const |
Returns number of poles. | |
Point | Pole (int theIndex) const |
Returns a pole value. | |
std::vector< Point > | Poles () const |
Populates a vector of weights. | |
double | Weight (int theIndex) const |
Returns a weight value. | |
std::vector< double > | Weights () const |
Populates a vector of weights. | |
![]() | |
Curve () | |
Constructor. | |
CurveType | Type () const |
Geom::Continuity | Continuity () const |
Returns a continuity type of the curve. | |
Point | Value (double theParameter) const |
Evaluates a point on the curve. | |
Direction | Normal (double theParameter) const |
Returns the normal direction theNormal of parameter theParam. | |
double | Curvature (double theParameter) const |
Returns the curvature value of parameter theParam. | |
bool | IsPeriodic () const |
Returns true if the curve is periodic. | |
double | UMin () const |
Returns a minimum parameter of a definition domain. | |
double | UMax () const |
Returns a maximum parameter of a definition domain. | |
void | Domain (double &theUMin, double &theUMax) const |
Returns a definition domain. | |
bool | IsTrimmed () const |
Returns whether curve is trimmed or not. | |
void | SetTrim (double theFirst, double theLast) |
Trims curve with [theFirst, theLast] section. | |
void | Transform (const Transformation &theTransformation) |
Applies transformation matrix to this object. | |
Curve | Transformed (const Transformation &theTransformation) const |
Returns a copy this object after applying transformation. | |
void | D0 (double theParameter, Point &theValue) const |
Returns the point theValue of parameter theParam. | |
void | D1 (double theParameter, Point &theValue, Vector &theD1) const |
Returns the point theValue of parameter theParam and the first derivative theD1. | |
void | D2 (double theParameter, Point &theValue, Vector &theD1, Vector &theD2) const |
Returns the point theValue of parameter theParam, the first theD1 and second theD2 derivatives. | |
bool | DN (double theParameter, size_t theDerivativeOrder, Geom::Point &theValue, std::vector< Geom::Vector > &theD) const |
void | Mirror (const Point &thePoint) |
void | Mirror (const Axis1d &theAxis) |
void | Mirror (const Axis3d &theAxis) |
Curve | Mirrored (const Point &theRef) const |
Curve | Mirrored (const Axis1d &theAxis) const |
Curve | Mirrored (const Axis3d &theAxis) const |
void | Rotate (const Axis1d &theAxis, double theAngle) |
Curve | Rotated (const Axis1d &theAxis, double theAngle) const |
void | Translate (const Vector &theVector) |
Curve | Translated (const Vector &theVector) const |
void | Scale (const Point &thePoint, double theScale) |
Curve | Scaled (const Point &thePoint, double theScale) const |
![]() | |
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 bool | CompareType (const BaseObject &theObject) |
![]() | |
static bool | CompareType (const BaseObject &theObject) |
Additional Inherited Members | |
![]() | |
typedef std::shared_ptr< internal::BaseObjectImpl > | ImplType |
![]() | |
Curve (const ImplType &theImpl) | |
![]() | |
Geometry (const ImplType &theImpl) | |
![]() | |
BaseObject (const ImplType &theImpl) | |
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:
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.
cadex::Geom::BezierCurve::BezierCurve | ( | const std::vector< Point > & | thePoles | ) |
Constructor.
Creates a polynomial Bezier curve.
thePoles and must belong to [2, 26]. Created curve has a degree equal to theNumberOfPoles - 1.
cadex::Geom::BezierCurve::BezierCurve | ( | const std::vector< Point > & | thePoles, |
const std::vector< double > & | thePoleWeights ) |
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.
int cadex::Geom::BezierCurve::Degree | ( | ) | const |
Returns degree.
Returns the value equal to NumberOfPoles() - 1.
int cadex::Geom::BezierCurve::NumberOfPoles | ( | ) | const |
Returns number of poles.
Returns the value specified in the constructor.
Point cadex::Geom::BezierCurve::Pole | ( | int | theIndex | ) | const |
std::vector< Point > cadex::Geom::BezierCurve::Poles | ( | ) | 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.
double cadex::Geom::BezierCurve::Weight | ( | int | theIndex | ) | const |
Returns a weight value.
theIndex must be in the range [1, NumberOfPoles()].
For polynomial Bezier behavior is undefined.
std::vector< double > cadex::Geom::BezierCurve::Weights | ( | ) | 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.