Defines 2D Bezier curve. More...
#include <cadex/Geom/BezierCurve2d.hxx>
Public Member Functions | |
BezierCurve2d () | |
Constructor. | |
BezierCurve2d (const std::vector< Point2d > &thePoles) | |
Constructor. | |
BezierCurve2d (const std::vector< Point2d > &thePoles, const std::vector< double > &thePoleWeights) | |
Constructor. | |
int | Degree () const |
Returns degree. | |
int | NumberOfPoles () const |
Returns number of poles. | |
Point2d | Pole (int theIndex) const |
Returns a pole value. | |
std::vector< Point2d > | Poles () const |
Populates a vector of poles. | |
double | Weight (int theIndex) const |
Returns a weight value. | |
std::vector< double > | Weights () const |
Populates a vector of weights. | |
![]() | |
Curve2d () | |
Constructor. | |
CurveType | Type () const |
Returns a curve type. | |
Geom::Continuity | Continuity () const |
Returns a continuity type of the curve. | |
Geom::Point2d | Value (double theParameter) const |
Evaluates a point on the curve. | |
Geom::Direction2d | Normal (double theParameter) const |
Returns the normal direction theNormal of parameter theParam. | |
double | Curvature (double theParameter) const |
Returns the curvature value of parameter theParam. | |
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 | D0 (double theParameter, Point2d &theValue) const |
Returns the point theValue of parameter theParam. | |
void | D1 (double theParameter, Point2d &theValue, Vector2d &theD1) const |
Returns the point theValue of parameter theParam and the first derivative theD1. | |
void | D2 (double theParameter, Point2d &theValue, Vector2d &theD1, Vector2d &theD2) const |
Returns the point theValue of parameter theParam and second derivatives theD1 and theD2. | |
bool | DN (double theParameter, size_t theDerivativeOrder, Geom::Point2d &theValue, std::vector< Geom::Vector2d > &theD) const |
void | Transform (const Transformation2d &theTransformation) |
Applies transformation matrix to this object. | |
Curve2d | Transformed (const Transformation2d &theTransformation) const |
Returns a copy this object after applying transformation. | |
![]() | |
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 |
![]() | |
Curve2d (const ImplType &theImpl) | |
![]() | |
Geometry (const ImplType &theImpl) | |
![]() | |
BaseObject (const ImplType &theImpl) | |
Defines 2D Bezier curve.
For detailed description refer to 3D counterpart BezierCurve.
cadex::Geom::BezierCurve2d::BezierCurve2d | ( | const std::vector< Point2d > & | 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::BezierCurve2d::BezierCurve2d | ( | const std::vector< Point2d > & | thePoles, |
const std::vector< double > & | thePoleWeights ) |
Constructor.
Creates a rational Bezier curve.
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::BezierCurve2d::Degree | ( | ) | const |
Returns degree.
Returns the value equal to NumberOfPoles() - 1.
int cadex::Geom::BezierCurve2d::NumberOfPoles | ( | ) | const |
Returns number of poles.
Returns the value specified in the constructor.
Point2d cadex::Geom::BezierCurve2d::Pole | ( | int | theIndex | ) | const |
std::vector< Point2d > cadex::Geom::BezierCurve2d::Poles | ( | ) | const |
Populates a vector of poles.
thePoles must point to a buffer in memory with at least NumberOfPoles() preallocated values.
Returns NumberOfPoles().
double cadex::Geom::BezierCurve2d::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::BezierCurve2d::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.