![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
Describes a rational or non-rational Bezier curve. More...
#include <Geom2d_BezierCurve.hxx>

Public Member Functions | |
| Geom2d_BezierCurve (const NCollection_Array1< gp_Pnt2d > &CurvePoles) | |
| Creates a non rational Bezier curve with a set of poles : CurvePoles. The weights are defaulted to all being 1. Raises ConstructionError if the number of poles is greater than MaxDegree + 1 or lower than 2. | |
| Geom2d_BezierCurve (const NCollection_Array1< gp_Pnt2d > &CurvePoles, const NCollection_Array1< double > &PoleWeights) | |
| Creates a rational Bezier curve with the set of poles CurvePoles and the set of weights PoleWeights. If all the weights are identical the curve is considered as non rational. Raises ConstructionError if the number of poles is greater than MaxDegree + 1 or lower than 2 or CurvePoles and CurveWeights have not the same length or one weight value is lower or equal to Resolution from package gp. | |
| Geom2d_BezierCurve (const Geom2d_BezierCurve &theOther) | |
| Copy constructor for optimized copying without validation. | |
| bool | HasEvalRepresentation () const |
| Returns true if an evaluation representation is attached. | |
| const occ::handle< Geom2dEval_RepCurveDesc::Base > & | EvalRepresentation () const |
| Returns the current evaluation representation descriptor (may be null). | |
| void | SetEvalRepresentation (const occ::handle< Geom2dEval_RepCurveDesc::Base > &theDesc) |
| Sets a new evaluation representation. Validates descriptor data and ensures no circular references. | |
| void | ClearEvalRepresentation () |
| Removes the evaluation representation. | |
| void | Increase (const int Degree) |
| Increases the degree of a bezier curve. Degree is the new degree of <me>. raises ConstructionError if Degree is greater than MaxDegree or lower than 2 or lower than the initial degree of <me>. | |
| void | InsertPoleAfter (const int Index, const gp_Pnt2d &P, const double Weight=1.0) |
| Inserts a pole with its weight in the set of poles after the pole of range Index. If the curve was non rational it can become rational if all the weights are not identical. Raised if Index is not in the range [0, NbPoles]. | |
| void | InsertPoleBefore (const int Index, const gp_Pnt2d &P, const double Weight=1.0) |
| Inserts a pole with its weight in the set of poles after the pole of range Index. If the curve was non rational it can become rational if all the weights are not identical. Raised if Index is not in the range [1, NbPoles+1]. | |
| void | RemovePole (const int Index) |
| Removes the pole of range Index. If the curve was rational it can become non rational. Raised if Index is not in the range [1, NbPoles]. | |
| void | Reverse () final |
| Reverses the direction of parametrization of <me> Value (NewU) = Value (1 - OldU) | |
| double | ReversedParameter (const double U) const final |
| Returns the parameter on the reversed curve for the point of parameter U on <me>. | |
| void | Segment (const double U1, const double U2) |
| Segments the curve between U1 and U2 which can be out of the bounds of the curve. The curve is oriented from U1 to U2. The control points are modified, the first and the last point are not the same but the parametrization range is [0, 1] else it could not be a Bezier curve. Warnings: Even if <me> is not closed it can become closed after the segmentation for example if U1 or U2 are out of the bounds of the curve <me> or if the curve makes loop. After the segmentation the length of a curve can be null. | |
| void | SetPole (const int Index, const gp_Pnt2d &P) |
| Substitutes the pole of range index with P. If the curve <me> is rational the weight of range Index is not modified. raiseD if Index is not in the range [1, NbPoles]. | |
| void | SetPole (const int Index, const gp_Pnt2d &P, const double Weight) |
| Substitutes the pole and the weights of range Index. If the curve <me> is not rational it can become rational if all the weights are not identical. If the curve was rational it can become non rational if all the weights are identical. Raised if Index is not in the range [1, NbPoles] Raised if Weight <= Resolution from package gp. | |
| void | SetWeight (const int Index, const double Weight) |
| Changes the weight of the pole of range Index. If the curve <me> is not rational it can become rational if all the weights are not identical. If the curve was rational it can become non rational if all the weights are identical. Raised if Index is not in the range [1, NbPoles] Raised if Weight <= Resolution from package gp. | |
| bool | IsClosed () const final |
| Returns True if the distance between the first point and the last point of the curve is lower or equal to the Resolution from package gp. | |
| bool | IsCN (const int N) const final |
| Continuity of the curve, returns True. | |
| bool | IsPeriodic () const final |
| Returns False. A BezierCurve cannot be periodic in this package. | |
| bool | IsRational () const |
| Returns false if all the weights are identical. The tolerance criterion is Resolution from package gp. | |
| GeomAbs_Shape | Continuity () const final |
| Returns GeomAbs_CN, which is the continuity of any Bezier curve. | |
| int | Degree () const |
| Returns the polynomial degree of the curve. It is the number of poles less one. In this package the Degree of a Bezier curve cannot be greater than "MaxDegree". | |
| gp_Pnt2d | EvalD0 (const double U) const final |
| Computes the point of parameter U. Raises an exception on failure. | |
| Geom2d_Curve::ResD1 | EvalD1 (const double U) const final |
| Computes the point and first derivative at parameter U. Raises an exception if the curve continuity is not C1. | |
| Geom2d_Curve::ResD2 | EvalD2 (const double U) const final |
| Computes the point and first two derivatives at parameter U. Raises an exception if the curve continuity is not C2. | |
| Geom2d_Curve::ResD3 | EvalD3 (const double U) const final |
| Computes the point and first three derivatives at parameter U. Raises an exception if the curve continuity is not C3. | |
| gp_Vec2d | EvalDN (const double U, const int N) const final |
| For this Bezier curve, computes. | |
| gp_Pnt2d | EndPoint () const final |
| Returns the end point or start point of this Bezier curve. | |
| double | FirstParameter () const final |
| Returns the value of the first parameter of this Bezier curve. This is 0.0, which gives the start point of this Bezier curve. | |
| double | LastParameter () const final |
| Returns the value of the last parameter of this Bezier curve. This is 1.0, which gives the end point of this Bezier curve. | |
| int | NbPoles () const |
| Returns the number of poles for this Bezier curve. | |
| const gp_Pnt2d & | Pole (const int Index) const |
| Returns the pole of range Index. Raised if Index is not in the range [1, NbPoles]. | |
| void | Poles (NCollection_Array1< gp_Pnt2d > &P) const |
| Returns all the poles of the curve. | |
| const NCollection_Array1< gp_Pnt2d > & | Poles () const |
| Returns all the poles of the curve. | |
| gp_Pnt2d | StartPoint () const final |
| Returns Value (U=1), it is the first control point of the curve. | |
| double | Weight (const int Index) const |
| Returns the weight of range Index. Raised if Index is not in the range [1, NbPoles]. | |
| void | Weights (NCollection_Array1< double > &W) const |
| Returns all the weights of the curve. | |
| const NCollection_Array1< double > * | Weights () const |
| Returns all the weights of the curve. | |
| const NCollection_Array1< double > & | WeightsArray () const |
| Returns a const reference to the weights array. For rational curves: the internal owning weights array. For non-rational curves: a non-owning view of unit weights from BSplCLib. The array is always sized to match NbPoles(). | |
| void | Transform (const gp_Trsf2d &T) final |
| Applies the transformation T to this Bezier curve. | |
| void | Resolution (const double ToleranceUV, double &UTolerance) |
| Computes for this Bezier curve the parametric tolerance UTolerance for a given tolerance Tolerance3D (relative to dimensions in the plane). If f(t) is the equation of this Bezier curve, UTolerance ensures that | t1 - t0| < Utolerance ===> |f(t1) - f(t0)| < ToleranceUV. | |
| occ::handle< Geom2d_Geometry > | Copy () const final |
| Creates a new object which is a copy of this Bezier curve. | |
| void | DumpJson (Standard_OStream &theOStream, int theDepth=-1) const final |
| Dumps the content of me into the stream. | |
| const NCollection_Array1< double > & | Knots () const |
| Returns Bezier knots {0.0, 1.0} as a static array. | |
| const NCollection_Array1< int > & | Multiplicities () const |
| Returns Bezier multiplicities for the current degree. | |
| const NCollection_Array1< double > & | KnotSequence () const |
| Returns Bezier flat knots for the current degree. | |
Public Member Functions inherited from Geom2d_BoundedCurve | |
| void | DumpJson (Standard_OStream &theOStream, int theDepth=-1) const override |
| Dumps the content of me into the stream. | |
Public Member Functions inherited from Geom2d_Curve | |
| virtual double | TransformedParameter (const double U, const gp_Trsf2d &T) const |
| Computes the parameter on the curve transformed by T for the point of parameter U on this curve. Note: this function generally returns U but it can be redefined (for example, on a line). | |
| virtual double | ParametricTransformation (const gp_Trsf2d &T) const |
| Returns the coefficient required to compute the parametric transformation of this curve when transformation T is applied. This coefficient is the ratio between the parameter of a point on this curve and the parameter of the transformed point on the new curve transformed by T. Note: this function generally returns 1. but it can be redefined (for example, on a line). | |
| occ::handle< Geom2d_Curve > | Reversed () const |
| Creates a reversed duplicate Changes the orientation of this curve. The first and last parameters are not changed, but the parametric direction of the curve is reversed. If the curve is bounded: | |
| virtual double | Period () const |
| Returns the period of this curve. raises if the curve is not periodic. | |
| void | D0 (const double U, gp_Pnt2d &P) const |
| Returns in P the point of parameter U. | |
| void | D1 (const double U, gp_Pnt2d &P, gp_Vec2d &V1) const |
| Returns the point P of parameter U and the first derivative V1. | |
| void | D2 (const double U, gp_Pnt2d &P, gp_Vec2d &V1, gp_Vec2d &V2) const |
| Returns the point P of parameter U, the first and second derivatives V1 and V2. | |
| void | D3 (const double U, gp_Pnt2d &P, gp_Vec2d &V1, gp_Vec2d &V2, gp_Vec2d &V3) const |
| Returns the point P of parameter U, the first, the second and the third derivative. | |
| gp_Vec2d | DN (const double U, const int N) const |
| Computes the Nth derivative vector. | |
| gp_Pnt2d | Value (const double U) const |
| Computes the point of parameter U on <me>. Implemented with D0. | |
| void | DumpJson (Standard_OStream &theOStream, int theDepth=-1) const override |
| Dumps the content of me into the stream. | |
Public Member Functions inherited from Geom2d_Geometry | |
| void | Mirror (const gp_Pnt2d &P) |
| Performs the symmetrical transformation of a Geometry with respect to the point P which is the center of the symmetry and assigns the result to this geometric object. | |
| void | Mirror (const gp_Ax2d &A) |
| Performs the symmetrical transformation of a Geometry with respect to an axis placement which is the axis of the symmetry. | |
| void | Rotate (const gp_Pnt2d &P, const double Ang) |
| Rotates a Geometry. P is the center of the rotation. Ang is the angular value of the rotation in radians. | |
| void | Scale (const gp_Pnt2d &P, const double S) |
| Scales a Geometry. S is the scaling value. | |
| void | Translate (const gp_Vec2d &V) |
| Translates a Geometry. V is the vector of the translation. | |
| void | Translate (const gp_Pnt2d &P1, const gp_Pnt2d &P2) |
| Translates a Geometry from the point P1 to the point P2. | |
| occ::handle< Geom2d_Geometry > | Mirrored (const gp_Pnt2d &P) const |
| occ::handle< Geom2d_Geometry > | Mirrored (const gp_Ax2d &A) const |
| occ::handle< Geom2d_Geometry > | Rotated (const gp_Pnt2d &P, const double Ang) const |
| occ::handle< Geom2d_Geometry > | Scaled (const gp_Pnt2d &P, const double S) const |
| occ::handle< Geom2d_Geometry > | Transformed (const gp_Trsf2d &T) const |
| occ::handle< Geom2d_Geometry > | Translated (const gp_Vec2d &V) const |
| occ::handle< Geom2d_Geometry > | Translated (const gp_Pnt2d &P1, const gp_Pnt2d &P2) const |
Public Member Functions inherited from Standard_Transient | |
| Standard_Transient () | |
| Empty constructor. | |
| Standard_Transient (const Standard_Transient &) | |
| Copy constructor – does nothing. | |
| Standard_Transient & | operator= (const Standard_Transient &) |
| Assignment operator, needed to avoid copying reference counter. | |
| virtual | ~Standard_Transient ()=default |
| Destructor must be virtual. | |
| virtual const opencascade::handle< Standard_Type > & | DynamicType () const |
| Returns a type descriptor about this object. | |
| bool | IsInstance (const opencascade::handle< Standard_Type > &theType) const |
| Returns a true value if this is an instance of Type. | |
| bool | IsInstance (const char *const theTypeName) const |
| Returns a true value if this is an instance of TypeName. | |
| bool | IsKind (const opencascade::handle< Standard_Type > &theType) const |
| Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. | |
| bool | IsKind (const char *const theTypeName) const |
| Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. | |
| Standard_Transient * | This () const |
| Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. | |
| int | GetRefCount () const noexcept |
| Get the reference counter of this object. | |
| void | IncrementRefCounter () noexcept |
| Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations. | |
| int | DecrementRefCounter () noexcept |
| Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement. | |
| virtual void | Delete () const |
| Memory deallocator for transient classes. | |
Static Public Member Functions | |
| static int | MaxDegree () |
| Returns the value of the maximum polynomial degree of a BezierCurve. This value is 25. | |
Static Public Member Functions inherited from Standard_Transient | |
| static constexpr const char * | get_type_name () |
| Returns a type descriptor about this object. | |
| static const opencascade::handle< Standard_Type > & | get_type_descriptor () |
| Returns type descriptor of Standard_Transient class. | |
Protected Member Functions | |
| void | init (const NCollection_Array1< gp_Pnt2d > &thePoles, const NCollection_Array1< double > *theWeights) |
| Set poles to thePoles, weights to theWeights. If theWeights is null the curve is non rational. Update rational and closed. | |
Additional Inherited Members | |
Public Types inherited from Standard_Transient | |
| typedef void | base_type |
| Returns a type descriptor about this object. | |
Describes a rational or non-rational Bezier curve.
| Geom2d_BezierCurve::Geom2d_BezierCurve | ( | const NCollection_Array1< gp_Pnt2d > & | CurvePoles | ) |
Creates a non rational Bezier curve with a set of poles : CurvePoles. The weights are defaulted to all being 1. Raises ConstructionError if the number of poles is greater than MaxDegree + 1 or lower than 2.
| Geom2d_BezierCurve::Geom2d_BezierCurve | ( | const NCollection_Array1< gp_Pnt2d > & | CurvePoles, |
| const NCollection_Array1< double > & | PoleWeights ) |
Creates a rational Bezier curve with the set of poles CurvePoles and the set of weights PoleWeights. If all the weights are identical the curve is considered as non rational. Raises ConstructionError if the number of poles is greater than MaxDegree + 1 or lower than 2 or CurvePoles and CurveWeights have not the same length or one weight value is lower or equal to Resolution from package gp.
| Geom2d_BezierCurve::Geom2d_BezierCurve | ( | const Geom2d_BezierCurve & | theOther | ) |
Copy constructor for optimized copying without validation.
|
inline |
Removes the evaluation representation.
|
finalvirtual |
Returns GeomAbs_CN, which is the continuity of any Bezier curve.
Implements Geom2d_Curve.
|
finalvirtual |
Creates a new object which is a copy of this Bezier curve.
Implements Geom2d_Geometry.
| int Geom2d_BezierCurve::Degree | ( | ) | const |
Returns the polynomial degree of the curve. It is the number of poles less one. In this package the Degree of a Bezier curve cannot be greater than "MaxDegree".
|
finalvirtual |
Dumps the content of me into the stream.
Reimplemented from Geom2d_Geometry.
|
finalvirtual |
Returns the end point or start point of this Bezier curve.
Implements Geom2d_BoundedCurve.
Computes the point of parameter U. Raises an exception on failure.
Implements Geom2d_Curve.
|
finalvirtual |
Computes the point and first derivative at parameter U. Raises an exception if the curve continuity is not C1.
Implements Geom2d_Curve.
|
finalvirtual |
Computes the point and first two derivatives at parameter U. Raises an exception if the curve continuity is not C2.
Implements Geom2d_Curve.
|
finalvirtual |
Computes the point and first three derivatives at parameter U. Raises an exception if the curve continuity is not C3.
Implements Geom2d_Curve.
For this Bezier curve, computes.
Implements Geom2d_Curve.
|
inline |
Returns the current evaluation representation descriptor (may be null).
|
finalvirtual |
Returns the value of the first parameter of this Bezier curve. This is 0.0, which gives the start point of this Bezier curve.
Implements Geom2d_Curve.
|
inline |
Returns true if an evaluation representation is attached.
Increases the degree of a bezier curve. Degree is the new degree of <me>. raises ConstructionError if Degree is greater than MaxDegree or lower than 2 or lower than the initial degree of <me>.
|
protected |
Set poles to thePoles, weights to theWeights. If theWeights is null the curve is non rational. Update rational and closed.
| void Geom2d_BezierCurve::InsertPoleAfter | ( | const int | Index, |
| const gp_Pnt2d & | P, | ||
| const double | Weight = 1.0 ) |
Inserts a pole with its weight in the set of poles after the pole of range Index. If the curve was non rational it can become rational if all the weights are not identical. Raised if Index is not in the range [0, NbPoles].
Raised if the resulting number of poles is greater than MaxDegree + 1.
| void Geom2d_BezierCurve::InsertPoleBefore | ( | const int | Index, |
| const gp_Pnt2d & | P, | ||
| const double | Weight = 1.0 ) |
Inserts a pole with its weight in the set of poles after the pole of range Index. If the curve was non rational it can become rational if all the weights are not identical. Raised if Index is not in the range [1, NbPoles+1].
Raised if the resulting number of poles is greater than MaxDegree + 1.
|
finalvirtual |
Returns True if the distance between the first point and the last point of the curve is lower or equal to the Resolution from package gp.
Implements Geom2d_Curve.
Continuity of the curve, returns True.
Implements Geom2d_Curve.
|
finalvirtual |
Returns False. A BezierCurve cannot be periodic in this package.
Implements Geom2d_Curve.
| bool Geom2d_BezierCurve::IsRational | ( | ) | const |
Returns false if all the weights are identical. The tolerance criterion is Resolution from package gp.
| const NCollection_Array1< double > & Geom2d_BezierCurve::Knots | ( | ) | const |
| const NCollection_Array1< double > & Geom2d_BezierCurve::KnotSequence | ( | ) | const |
Returns Bezier flat knots for the current degree.
|
finalvirtual |
Returns the value of the last parameter of this Bezier curve. This is 1.0, which gives the end point of this Bezier curve.
Implements Geom2d_Curve.
Returns the value of the maximum polynomial degree of a BezierCurve. This value is 25.
| const NCollection_Array1< int > & Geom2d_BezierCurve::Multiplicities | ( | ) | const |
Returns Bezier multiplicities for the current degree.
| int Geom2d_BezierCurve::NbPoles | ( | ) | const |
Returns the number of poles for this Bezier curve.
Returns the pole of range Index. Raised if Index is not in the range [1, NbPoles].
|
inline |
Returns all the poles of the curve.
| void Geom2d_BezierCurve::Poles | ( | NCollection_Array1< gp_Pnt2d > & | P | ) | const |
Returns all the poles of the curve.
Raised if the length of P is not equal to the number of poles.
Removes the pole of range Index. If the curve was rational it can become non rational. Raised if Index is not in the range [1, NbPoles].
|
finalvirtual |
Reverses the direction of parametrization of <me> Value (NewU) = Value (1 - OldU)
Implements Geom2d_Curve.
Returns the parameter on the reversed curve for the point of parameter U on <me>.
returns 1-U
Implements Geom2d_Curve.
Segments the curve between U1 and U2 which can be out of the bounds of the curve. The curve is oriented from U1 to U2. The control points are modified, the first and the last point are not the same but the parametrization range is [0, 1] else it could not be a Bezier curve. Warnings: Even if <me> is not closed it can become closed after the segmentation for example if U1 or U2 are out of the bounds of the curve <me> or if the curve makes loop. After the segmentation the length of a curve can be null.
| void Geom2d_BezierCurve::SetEvalRepresentation | ( | const occ::handle< Geom2dEval_RepCurveDesc::Base > & | theDesc | ) |
Sets a new evaluation representation. Validates descriptor data and ensures no circular references.
Substitutes the pole of range index with P. If the curve <me> is rational the weight of range Index is not modified. raiseD if Index is not in the range [1, NbPoles].
Substitutes the pole and the weights of range Index. If the curve <me> is not rational it can become rational if all the weights are not identical. If the curve was rational it can become non rational if all the weights are identical. Raised if Index is not in the range [1, NbPoles] Raised if Weight <= Resolution from package gp.
Changes the weight of the pole of range Index. If the curve <me> is not rational it can become rational if all the weights are not identical. If the curve was rational it can become non rational if all the weights are identical. Raised if Index is not in the range [1, NbPoles] Raised if Weight <= Resolution from package gp.
|
finalvirtual |
Returns Value (U=1), it is the first control point of the curve.
Implements Geom2d_BoundedCurve.
Applies the transformation T to this Bezier curve.
Implements Geom2d_Geometry.
Returns the weight of range Index. Raised if Index is not in the range [1, NbPoles].
|
inline |
Returns all the weights of the curve.
| void Geom2d_BezierCurve::Weights | ( | NCollection_Array1< double > & | W | ) | const |
Returns all the weights of the curve.
Raised if the length of W is not equal to the number of poles.
|
inline |