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

Public Member Functions | |
| Geom_BezierCurve (const NCollection_Array1< gp_Pnt > &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. | |
| Geom_BezierCurve (const NCollection_Array1< gp_Pnt > &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. | |
| Geom_BezierCurve (const Geom_BezierCurve &theOther) | |
| Copy constructor for optimized copying without validation. | |
| bool | HasEvalRepresentation () const |
| Returns true if an evaluation representation is attached. | |
| const occ::handle< GeomEval_RepCurveDesc::Base > & | EvalRepresentation () const |
| Returns the current evaluation representation descriptor (may be null). | |
| void | SetEvalRepresentation (const occ::handle< GeomEval_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_Pnt &P) |
| Inserts a pole P after the pole of range Index. If the curve <me> is rational the weight value for the new pole of range Index is 1.0. raised if Index is not in the range [1, NbPoles]. | |
| void | InsertPoleAfter (const int Index, const gp_Pnt &P, const double Weight) |
| 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]. | |
| void | InsertPoleBefore (const int Index, const gp_Pnt &P) |
| Inserts a pole P before the pole of range Index. If the curve <me> is rational the weight value for the new pole of range Index is 1.0. Raised if Index is not in the range [1, NbPoles]. | |
| void | InsertPoleBefore (const int Index, const gp_Pnt &P, const double Weight) |
| 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]. | |
| 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] Raised if Degree is lower than 2. | |
| 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_Pnt &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_Pnt &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 True if the parametrization of a curve is periodic. (P(u) = P(u + T) T = constante) | |
| bool | IsRational () const |
| Returns false if all the weights are identical. The tolerance criterion is Resolution from package gp. | |
| GeomAbs_Shape | Continuity () const final |
| a Bezier curve is CN | |
| int | Degree () const |
| Returns the polynomial degree of the curve. it is the number of poles - 1 point P and derivatives (V1, V2, V3) computation The Bezier Curve has a Polynomial representation so the parameter U can be out of the bounds of the curve. | |
| gp_Pnt | EvalD0 (const double U) const final |
| Computes the point of parameter U. Raises an exception on failure (e.g. OffsetCurve at singular point). | |
| Geom_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. | |
| Geom_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. | |
| Geom_Curve::ResD3 | EvalD3 (const double U) const final |
| For this Bezier curve, computes. | |
| gp_Vec | EvalDN (const double U, const int N) const final |
| For the point of parameter U of this Bezier curve, computes the vector corresponding to the Nth derivative. Note: the parameter U can be outside the bounds of the curve. Exceptions Standard_RangeError if N is less than 1. | |
| gp_Pnt | StartPoint () const final |
| Returns Value (U=0.), it is the first control point of the curve. | |
| gp_Pnt | EndPoint () const final |
| Returns Value (U=1.), it is the last control point of the 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 of this Bezier curve. | |
| const gp_Pnt & | 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_Pnt > &P) const |
| Returns all the poles of the curve. | |
| const NCollection_Array1< gp_Pnt > & | Poles () const |
| Returns all the poles 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_Trsf &T) final |
| Applies the transformation T to this Bezier curve. | |
| void | Resolution (const double Tolerance3D, double &UTolerance) |
| Computes for this Bezier curve the parametric tolerance UTolerance for a given 3D tolerance Tolerance3D. If f(t) is the equation of this Bezier curve, UTolerance ensures that: |t1-t0| < UTolerance ===> |f(t1)-f(t0)| < Tolerance3D. | |
| occ::handle< Geom_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 Geom_BoundedCurve | |
| void | DumpJson (Standard_OStream &theOStream, int theDepth=-1) const override |
| Dumps the content of me into the stream. | |
Public Member Functions inherited from Geom_Curve | |
| virtual double | TransformedParameter (const double U, const gp_Trsf &T) const |
| Returns the parameter on the transformed curve for the transform of the point of parameter U on <me>. | |
| virtual double | ParametricTransformation (const gp_Trsf &T) const |
| Returns a coefficient to compute the parameter on the transformed curve for the transform of the point on <me>. | |
| occ::handle< Geom_Curve > | Reversed () const |
| Returns a copy of <me> reversed. | |
| virtual double | Period () const |
| Returns the period of this curve. Exceptions Standard_NoSuchObject if this curve is not periodic. | |
| void | D0 (const double U, gp_Pnt &P) const |
| Returns in P the point of parameter U. | |
| void | D1 (const double U, gp_Pnt &P, gp_Vec &V1) const |
| Returns the point P of parameter U and the first derivative V1. | |
| void | D2 (const double U, gp_Pnt &P, gp_Vec &V1, gp_Vec &V2) const |
| Returns the point P of parameter U, the first and second derivatives V1 and V2. | |
| void | D3 (const double U, gp_Pnt &P, gp_Vec &V1, gp_Vec &V2, gp_Vec &V3) const |
| Returns the point P of parameter U, the first, the second and the third derivative. | |
| gp_Vec | DN (const double U, const int N) const |
| The returned vector gives the value of the derivative for the order of derivation N. | |
| gp_Pnt | Value (const double U) const |
| Computes the point of parameter U on <me>. | |
| void | DumpJson (Standard_OStream &theOStream, int theDepth=-1) const override |
| Dumps the content of me into the stream. | |
Public Member Functions inherited from Geom_Geometry | |
| void | Mirror (const gp_Pnt &P) |
| Performs the symmetrical transformation of a Geometry with respect to the point P which is the center of the symmetry. | |
| void | Mirror (const gp_Ax1 &A1) |
| Performs the symmetrical transformation of a Geometry with respect to an axis placement which is the axis of the symmetry. | |
| void | Mirror (const gp_Ax2 &A2) |
| Performs the symmetrical transformation of a Geometry with respect to a plane. The axis placement A2 locates the plane of the symmetry : (Location, XDirection, YDirection). | |
| void | Rotate (const gp_Ax1 &A1, const double Ang) |
| Rotates a Geometry. A1 is the axis of the rotation. Ang is the angular value of the rotation in radians. | |
| void | Scale (const gp_Pnt &P, const double S) |
| Scales a Geometry. S is the scaling value. | |
| void | Translate (const gp_Vec &V) |
| Translates a Geometry. V is the vector of the translation. | |
| void | Translate (const gp_Pnt &P1, const gp_Pnt &P2) |
| Translates a Geometry from the point P1 to the point P2. | |
| occ::handle< Geom_Geometry > | Mirrored (const gp_Pnt &P) const |
| occ::handle< Geom_Geometry > | Mirrored (const gp_Ax1 &A1) const |
| occ::handle< Geom_Geometry > | Mirrored (const gp_Ax2 &A2) const |
| occ::handle< Geom_Geometry > | Rotated (const gp_Ax1 &A1, const double Ang) const |
| occ::handle< Geom_Geometry > | Scaled (const gp_Pnt &P, const double S) const |
| occ::handle< Geom_Geometry > | Transformed (const gp_Trsf &T) const |
| occ::handle< Geom_Geometry > | Translated (const gp_Vec &V) const |
| occ::handle< Geom_Geometry > | Translated (const gp_Pnt &P1, const gp_Pnt &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 any Geom_BezierCurve curve. 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_Pnt > &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.
| Geom_BezierCurve::Geom_BezierCurve | ( | const NCollection_Array1< gp_Pnt > & | 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.
| Geom_BezierCurve::Geom_BezierCurve | ( | const NCollection_Array1< gp_Pnt > & | 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.
| Geom_BezierCurve::Geom_BezierCurve | ( | const Geom_BezierCurve & | theOther | ) |
Copy constructor for optimized copying without validation.
| [in] | theOther | the Bezier curve to copy from |
|
inline |
Removes the evaluation representation.
|
finalvirtual |
a Bezier curve is CN
Implements Geom_Curve.
|
finalvirtual |
Creates a new object which is a copy of this Bezier curve.
Implements Geom_Geometry.
| int Geom_BezierCurve::Degree | ( | ) | const |
Returns the polynomial degree of the curve. it is the number of poles - 1 point P and derivatives (V1, V2, V3) computation The Bezier Curve has a Polynomial representation so the parameter U can be out of the bounds of the curve.
|
finalvirtual |
Dumps the content of me into the stream.
Reimplemented from Geom_Geometry.
|
finalvirtual |
Returns Value (U=1.), it is the last control point of the Bezier curve.
Implements Geom_BoundedCurve.
Computes the point of parameter U. Raises an exception on failure (e.g. OffsetCurve at singular point).
Implements Geom_Curve.
|
finalvirtual |
Computes the point and first derivative at parameter U. Raises an exception if the curve continuity is not C1.
Implements Geom_Curve.
|
finalvirtual |
Computes the point and first two derivatives at parameter U. Raises an exception if the curve continuity is not C2.
Implements Geom_Curve.
|
finalvirtual |
For this Bezier curve, computes.
Implements Geom_Curve.
For the point of parameter U of this Bezier curve, computes the vector corresponding to the Nth derivative. Note: the parameter U can be outside the bounds of the curve. Exceptions Standard_RangeError if N is less than 1.
Implements Geom_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 Geom_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.
Inserts a pole P after the pole of range Index. If the curve <me> is rational the weight value for the new pole of range Index is 1.0. raised if Index is not in the range [1, NbPoles].
raised if the resulting number of poles is greater than MaxDegree + 1.
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].
Raised if the resulting number of poles is greater than MaxDegree + 1. Raised if Weight is lower or equal to Resolution from package gp.
Inserts a pole P before the pole of range Index. If the curve <me> is rational the weight value for the new pole of range Index is 1.0. Raised if Index is not in the range [1, NbPoles].
Raised if the resulting number of poles is greater than MaxDegree + 1.
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].
Raised if the resulting number of poles is greater than MaxDegree + 1. Raised if Weight is lower or equal to Resolution from package gp.
|
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 Geom_Curve.
Continuity of the curve, returns True.
Implements Geom_Curve.
|
finalvirtual |
Returns True if the parametrization of a curve is periodic. (P(u) = P(u + T) T = constante)
Implements Geom_Curve.
| bool Geom_BezierCurve::IsRational | ( | ) | const |
Returns false if all the weights are identical. The tolerance criterion is Resolution from package gp.
| const NCollection_Array1< double > & Geom_BezierCurve::Knots | ( | ) | const |
| const NCollection_Array1< double > & Geom_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 Geom_Curve.
Returns the value of the maximum polynomial degree of any Geom_BezierCurve curve. This value is 25.
| const NCollection_Array1< int > & Geom_BezierCurve::Multiplicities | ( | ) | const |
Returns Bezier multiplicities for the current degree.
| int Geom_BezierCurve::NbPoles | ( | ) | const |
Returns the number of poles of this Bezier curve.
Returns the pole of range Index. Raised if Index is not in the range [1, NbPoles].
| const NCollection_Array1< gp_Pnt > & Geom_BezierCurve::Poles | ( | ) | const |
Returns all the poles of the curve.
| void Geom_BezierCurve::Poles | ( | NCollection_Array1< gp_Pnt > & | 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] Raised if Degree is lower than 2.
|
finalvirtual |
Reverses the direction of parametrization of <me> Value (NewU) = Value (1 - OldU)
Implements Geom_Curve.
Returns the parameter on the reversed curve for the point of parameter U on <me>.
returns 1-U
Implements Geom_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 Geom_BezierCurve::SetEvalRepresentation | ( | const occ::handle< GeomEval_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=0.), it is the first control point of the curve.
Implements Geom_BoundedCurve.
Applies the transformation T to this Bezier curve.
Implements Geom_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 Geom_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 |