Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions
Geom2d_BSplineCurve Class Reference

Describes a BSpline curve. A BSpline curve can be: More...

#include <Geom2d_BSplineCurve.hxx>

Inheritance diagram for Geom2d_BSplineCurve:
Inheritance graph
[legend]

Public Member Functions

 Geom2d_BSplineCurve (const NCollection_Array1< gp_Pnt2d > &Poles, const NCollection_Array1< double > &Knots, const NCollection_Array1< int > &Multiplicities, const int Degree, const bool Periodic=false)
 Creates a non-rational B_spline curve on the basis <Knots, Multiplicities> of degree <Degree>. The following conditions must be verified. 0 < Degree <= MaxDegree.
 
 Geom2d_BSplineCurve (const NCollection_Array1< gp_Pnt2d > &Poles, const NCollection_Array1< double > &Weights, const NCollection_Array1< double > &Knots, const NCollection_Array1< int > &Multiplicities, const int Degree, const bool Periodic=false)
 Creates a rational B_spline curve on the basis <Knots, Multiplicities> of degree <Degree>. The following conditions must be verified. 0 < Degree <= MaxDegree.
 
 Geom2d_BSplineCurve (const Geom2d_BSplineCurve &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 IncreaseDegree (const int Degree)
 Increases the degree of this BSpline curve to Degree. As a result, the poles, weights and multiplicities tables are modified; the knots table is not changed. Nothing is done if Degree is less than or equal to the current degree. Exceptions Standard_ConstructionError if Degree is greater than Geom2d_BSplineCurve::MaxDegree().
 
void IncreaseMultiplicity (const int Index, const int M)
 Increases the multiplicity of the knot <Index> to <M>.
 
void IncreaseMultiplicity (const int I1, const int I2, const int M)
 Increases the multiplicities of the knots in [I1,I2] to <M>.
 
void IncrementMultiplicity (const int I1, const int I2, const int M)
 Increases by M the multiplicity of the knots of indexes I1 to I2 in the knots table of this BSpline curve. For each knot, the resulting multiplicity is limited to the degree of this curve. If M is negative, nothing is done. As a result, the poles and weights tables of this BSpline curve are modified. Warning It is forbidden to modify the multiplicity of the first or last knot of a non-periodic curve. Be careful as Geom2d does not protect against this. Exceptions Standard_OutOfRange if I1 or I2 is outside the bounds of the knots table.
 
void InsertKnot (const double U, const int M=1, const double ParametricTolerance=0.0)
 Inserts a knot value in the sequence of knots. If is an existing knot the multiplicity is increased by <M>.
 
void InsertKnots (const NCollection_Array1< double > &Knots, const NCollection_Array1< int > &Mults, const double ParametricTolerance=0.0, const bool Add=false)
 Inserts the values of the array Knots, with the respective multiplicities given by the array Mults, into the knots table of this BSpline curve. If a value of the array Knots is an existing knot, its multiplicity is:
 
bool RemoveKnot (const int Index, const int M, const double Tolerance)
 Reduces the multiplicity of the knot of index Index to M. If M is equal to 0, the knot is removed. With a modification of this type, the array of poles is also modified. Two different algorithms are systematically used to compute the new poles of the curve. If, for each pole, the distance between the pole calculated using the first algorithm and the same pole calculated using the second algorithm, is less than Tolerance, this ensures that the curve is not modified by more than Tolerance. Under these conditions, true is returned; otherwise, false is returned. A low tolerance is used to prevent modification of the curve. A high tolerance is used to "smooth" the curve. Exceptions Standard_OutOfRange if Index is outside the bounds of the knots table.
 
void InsertPoleAfter (const int Index, const gp_Pnt2d &P, const double Weight=1.0)
 The new pole is inserted after the pole of range Index. If the curve was non rational it can become rational.
 
void InsertPoleBefore (const int Index, const gp_Pnt2d &P, const double Weight=1.0)
 The new pole is inserted before the pole of range Index. If the curve was non rational it can become rational.
 
void RemovePole (const int Index)
 Removes the pole of range Index If the curve was rational it can become non rational.
 
void Reverse () final
 Reverses the orientation of this BSpline curve. As a result.
 
double ReversedParameter (const double U) const final
 Computes the parameter on the reversed curve for the point of parameter U on this BSpline curve. The returned value is: UFirst + ULast - U, where UFirst and ULast are the values of the first and last parameters of this BSpline curve.
 
void Segment (const double U1, const double U2, const double theTolerance=Precision::PConfusion())
 Modifies this BSpline curve by segmenting it between U1 and U2. Either of these values can be outside the bounds of the curve, but U2 must be greater than U1. All data structure tables of this BSpline curve are modified, but the knots located between U1 and U2 are retained. The degree of the curve is not modified.
 
void SetKnot (const int Index, const double K)
 Modifies this BSpline curve by assigning the value K to the knot of index Index in the knots table. This is a relatively local modification because K must be such that: Knots(Index - 1) < K < Knots(Index + 1) Exceptions Standard_ConstructionError if:
 
void SetKnots (const NCollection_Array1< double > &K)
 Modifies this BSpline curve by assigning the array K to its knots table. The multiplicity of the knots is not modified. Exceptions Standard_ConstructionError if the values in the array K are not in ascending order. Standard_OutOfRange if the bounds of the array K are not respectively 1 and the number of knots of this BSpline curve.
 
void SetKnot (const int Index, const double K, const int M)
 Modifies this BSpline curve by assigning the value K to the knot of index Index in the knots table. This is a relatively local modification because K must be such that: Knots(Index - 1) < K < Knots(Index + 1) The second syntax allows you also to increase the multiplicity of the knot to M (but it is not possible to decrease the multiplicity of the knot with this function). Exceptions Standard_ConstructionError if:
 
void PeriodicNormalization (double &U) const
 Computes the parameter normalized within the "first" period of this BSpline curve, if it is periodic: the returned value is in the range Param1 and Param1 + Period, where:
 
void SetPeriodic ()
 Changes this BSpline curve into a periodic curve. To become periodic, the curve must first be closed. Next, the knot sequence must be periodic. For this, FirstUKnotIndex and LastUKnotIndex are used to compute I1 and I2, the indexes in the knots array of the knots corresponding to the first and last parameters of this BSpline curve. The period is therefore Knot(I2) - Knot(I1). Consequently, the knots and poles tables are modified. Exceptions Standard_ConstructionError if this BSpline curve is not closed.
 
void SetOrigin (const int Index)
 Assigns the knot of index Index in the knots table as the origin of this periodic BSpline curve. As a consequence, the knots and poles tables are modified. Exceptions Standard_NoSuchObject if this curve is not periodic. Standard_DomainError if Index is outside the bounds of the knots table.
 
void SetNotPeriodic ()
 Changes this BSpline curve into a non-periodic curve. If this curve is already non-periodic, it is not modified. Note that the poles and knots tables are modified. Warning If this curve is periodic, as the multiplicity of the first and last knots is not modified, and is not equal to Degree + 1, where Degree is the degree of this BSpline curve, the start and end points of the curve are not its first and last poles.
 
void SetPole (const int Index, const gp_Pnt2d &P)
 Modifies this BSpline curve by assigning P to the pole of index Index in the poles table. Exceptions Standard_OutOfRange if Index is outside the bounds of the poles table. Standard_ConstructionError if Weight is negative or null.
 
void SetPole (const int Index, const gp_Pnt2d &P, const double Weight)
 Modifies this BSpline curve by assigning P to the pole of index Index in the poles table. The second syntax also allows you to modify the weight of the modified pole, which becomes Weight. In this case, if this BSpline curve is non-rational, it can become rational and vice versa. Exceptions Standard_OutOfRange if Index is outside the bounds of the poles table. Standard_ConstructionError if Weight is negative or null.
 
void SetWeight (const int Index, const double Weight)
 Assigns the weight Weight to the pole of index Index of the poles table. If the curve was non rational it can become rational. If the curve was rational it can become non rational. Exceptions Standard_OutOfRange if Index is outside the bounds of the poles table. Standard_ConstructionError if Weight is negative or null.
 
void MovePoint (const double U, const gp_Pnt2d &P, const int Index1, const int Index2, int &FirstModifiedPole, int &LastModifiedPole)
 Moves the point of parameter U of this BSpline curve to P. Index1 and Index2 are the indexes in the table of poles of this BSpline curve of the first and last poles designated to be moved. FirstModifiedPole and LastModifiedPole are the indexes of the first and last poles, which are effectively modified. In the event of incompatibility between Index1, Index2 and the value U:
 
void MovePointAndTangent (const double U, const gp_Pnt2d &P, const gp_Vec2d &Tangent, const double Tolerance, const int StartingCondition, const int EndingCondition, int &ErrorStatus)
 Move a point with parameter U to P. and makes it tangent at U be Tangent. StartingCondition = -1 means first can move EndingCondition = -1 means last point can move StartingCondition = 0 means the first point cannot move EndingCondition = 0 means the last point cannot move StartingCondition = 1 means the first point and tangent cannot move EndingCondition = 1 means the last point and tangent cannot move and so forth ErrorStatus != 0 means that there are not enough degree of freedom with the constrain to deform the curve accordingly.
 
bool IsCN (const int N) const final
 Returns true if the degree of continuity of this BSpline curve is at least N. A BSpline curve is at least GeomAbs_C0. Exceptions Standard_RangeError if N is negative.
 
bool IsG1 (const double theTf, const double theTl, const double theAngTol) const
 Check if curve has at least G1 continuity in interval [theTf, theTl] Returns true if IsCN(1) or angle between "left" and "right" first derivatives at knots with C0 continuity is less then theAngTol only knots in interval [theTf, theTl] is checked.
 
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 Resolution from package gp. Warnings : The first and the last point can be different from the first pole and the last pole of the curve.
 
bool IsPeriodic () const final
 Returns True if the curve is periodic.
 
bool IsRational () const
 Returns True if the weights are not identical. The tolerance criterion is Epsilon of the class Real.
 
GeomAbs_Shape Continuity () const final
 Returns the global continuity of the curve : C0 : only geometric continuity, C1 : continuity of the first derivative all along the Curve, C2 : continuity of the second derivative all along the Curve, C3 : continuity of the third derivative all along the Curve, CN : the order of continuity is infinite. For a B-spline curve of degree d if a knot Ui has a multiplicity p the B-spline curve is only Cd-p continuous at Ui. So the global continuity of the curve can't be greater than Cd-p where p is the maximum multiplicity of the interior Knots. In the interior of a knot span the curve is infinitely continuously differentiable.
 
int Degree () const
 Returns the degree of this BSpline curve. In this class the degree of the basis normalized B-spline functions cannot be greater than "MaxDegree" Computation of value and derivatives.
 
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
 Raised if the continuity of the curve is not C1.
 
Geom2d_Curve::ResD2 EvalD2 (const double U) const final
 Raised if the continuity of the curve is not C2.
 
Geom2d_Curve::ResD3 EvalD3 (const double U) const final
 For this BSpline curve, computes.
 
gp_Vec2d EvalDN (const double U, const int N) const final
 For the point of parameter U of this BSpline curve, computes the vector corresponding to the Nth derivative. Warning On a point where the continuity of the curve is not the one requested, this function impacts the part defined by the parameter with a value greater than U, i.e. the part of the curve to the "right" of the singularity. Raises UndefinedDerivative if the continuity of the curve is not CN. RangeError if N < 1. The following functions computes the point of parameter U and the derivatives at this point on the B-spline curve arc defined between the knot FromK1 and the knot ToK2. U can be out of bounds [Knot (FromK1), Knot (ToK2)] but for the computation we only use the definition of the curve between these two knots. This method is useful to compute local derivative, if the order of continuity of the whole curve is not greater enough. Inside the parametric domain Knot (FromK1), Knot (ToK2) the evaluations are the same as if we consider the whole definition of the curve. Of course the evaluations are different outside this parametric domain.
 
gp_Pnt2d LocalValue (const double U, const int FromK1, const int ToK2) const
 Raised if FromK1 = ToK2.
 
void LocalD0 (const double U, const int FromK1, const int ToK2, gp_Pnt2d &P) const
 Raised if FromK1 = ToK2.
 
void LocalD1 (const double U, const int FromK1, const int ToK2, gp_Pnt2d &P, gp_Vec2d &V1) const
 Raised if the local continuity of the curve is not C1 between the knot K1 and the knot K2. Raised if FromK1 = ToK2.
 
void LocalD2 (const double U, const int FromK1, const int ToK2, gp_Pnt2d &P, gp_Vec2d &V1, gp_Vec2d &V2) const
 Raised if the local continuity of the curve is not C2 between the knot K1 and the knot K2. Raised if FromK1 = ToK2.
 
void LocalD3 (const double U, const int FromK1, const int ToK2, gp_Pnt2d &P, gp_Vec2d &V1, gp_Vec2d &V2, gp_Vec2d &V3) const
 Raised if the local continuity of the curve is not C3 between the knot K1 and the knot K2. Raised if FromK1 = ToK2.
 
gp_Vec2d LocalDN (const double U, const int FromK1, const int ToK2, const int N) const
 Raised if the local continuity of the curve is not CN between the knot K1 and the knot K2. Raised if FromK1 = ToK2. Raised if N < 1.
 
gp_Pnt2d EndPoint () const final
 Returns the last point of the curve. Warnings : The last point of the curve is different from the last pole of the curve if the multiplicity of the last knot is lower than Degree.
 
int FirstUKnotIndex () const
 For a B-spline curve the first parameter (which gives the start point of the curve) is a knot value but if the multiplicity of the first knot index is lower than Degree + 1 it is not the first knot of the curve. This method computes the index of the knot corresponding to the first parameter.
 
double FirstParameter () const final
 Computes the parametric value of the start point of the curve. It is a knot value.
 
double Knot (const int Index) const
 Returns the knot of range Index. When there is a knot with a multiplicity greater than 1 the knot is not repeated. The method Multiplicity can be used to get the multiplicity of the Knot. Raised if Index < 1 or Index > NbKnots.
 
void Knots (NCollection_Array1< double > &K) const
 returns the knot values of the B-spline curve;
 
const NCollection_Array1< double > & Knots () const
 returns the knot values of the B-spline curve;
 
void KnotSequence (NCollection_Array1< double > &K) const
 Returns the knots sequence. In this sequence the knots with a multiplicity greater than 1 are repeated. Example : K = {k1, k1, k1, k2, k3, k3, k4, k4, k4}.
 
const NCollection_Array1< double > & KnotSequence () const
 Returns the knots sequence. In this sequence the knots with a multiplicity greater than 1 are repeated. Example : K = {k1, k1, k1, k2, k3, k3, k4, k4, k4}.
 
GeomAbs_BSplKnotDistribution KnotDistribution () const
 Returns NonUniform or Uniform or QuasiUniform or PiecewiseBezier. If all the knots differ by a positive constant from the preceding knot the BSpline Curve can be :
 
int LastUKnotIndex () const
 For a BSpline curve the last parameter (which gives the end point of the curve) is a knot value but if the multiplicity of the last knot index is lower than Degree + 1 it is not the last knot of the curve. This method computes the index of the knot corresponding to the last parameter.
 
double LastParameter () const final
 Computes the parametric value of the end point of the curve. It is a knot value.
 
void LocateU (const double U, const double ParametricTolerance, int &I1, int &I2, const bool WithKnotRepetition=false) const
 Locates the parametric value U in the sequence of knots. If "WithKnotRepetition" is True we consider the knot's representation with repetition of multiple knot value, otherwise we consider the knot's representation with no repetition of multiple knot values. Knots (I1) <= U <= Knots (I2) . if I1 = I2 U is a knot value (the tolerance criterion ParametricTolerance is used). . if I1 < 1 => U < Knots (1) - std::abs(ParametricTolerance) . if I2 > NbKnots => U > Knots (NbKnots) + std::abs(ParametricTolerance)
 
int Multiplicity (const int Index) const
 Returns the multiplicity of the knots of range Index. Raised if Index < 1 or Index > NbKnots.
 
void Multiplicities (NCollection_Array1< int > &M) const
 Returns the multiplicity of the knots of the curve.
 
const NCollection_Array1< int > & Multiplicities () const
 returns the multiplicity of the knots of the curve.
 
int NbKnots () const
 Returns the number of knots. This method returns the number of knot without repetition of multiple knots.
 
int NbPoles () const
 Returns the number of poles.
 
const gp_Pnt2dPole (const int Index) const
 Returns the pole of range Index. Raised if Index < 1 or Index > NbPoles.
 
void Poles (NCollection_Array1< gp_Pnt2d > &P) const
 Returns the poles of the B-spline curve;.
 
const NCollection_Array1< gp_Pnt2d > & Poles () const
 Returns the poles of the B-spline curve;.
 
gp_Pnt2d StartPoint () const final
 Returns the start point of the curve. Warnings : This point is different from the first pole of the curve if the multiplicity of the first knot is lower than Degree.
 
double Weight (const int Index) const
 Returns the weight of the pole of range Index . Raised if Index < 1 or Index > NbPoles.
 
void Weights (NCollection_Array1< double > &W) const
 Returns the weights of the B-spline curve;.
 
const NCollection_Array1< double > * Weights () const
 Returns the weights of the B-spline 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 BSpline curve.
 
void Resolution (const double ToleranceUV, double &UTolerance)
 Computes for this BSpline curve the parametric tolerance UTolerance for a given tolerance Tolerance3D (relative to dimensions in the plane). If f(t) is the equation of this BSpline curve, UTolerance ensures that: | t1 - t0| < Utolerance ===> |f(t1) - f(t0)| < ToleranceUV.
 
occ::handle< Geom2d_GeometryCopy () const final
 Creates a new object which is a copy of this BSpline curve.
 
void DumpJson (Standard_OStream &theOStream, int theDepth=-1) const final
 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_CurveReversed () 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_GeometryMirrored (const gp_Pnt2d &P) const
 
occ::handle< Geom2d_GeometryMirrored (const gp_Ax2d &A) const
 
occ::handle< Geom2d_GeometryRotated (const gp_Pnt2d &P, const double Ang) const
 
occ::handle< Geom2d_GeometryScaled (const gp_Pnt2d &P, const double S) const
 
occ::handle< Geom2d_GeometryTransformed (const gp_Trsf2d &T) const
 
occ::handle< Geom2d_GeometryTranslated (const gp_Vec2d &V) const
 
occ::handle< Geom2d_GeometryTranslated (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_Transientoperator= (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_TransientThis () 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 degree of the normalized B-spline basis functions in this package.
 
- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_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 updateKnots ()
 Recompute the flatknots, the knotsdistribution, the continuity.
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 

Detailed Description

Describes a BSpline curve. A BSpline curve can be:

References : . A survey of curve and surface methods in CADG Wolfgang BOHM CAGD 1 (1984) . On de Boor-like algorithms and blossoming Wolfgang BOEHM cagd 5 (1988) . Blossoming and knot insertion algorithms for B-spline curves Ronald N. GOLDMAN . Modelisation des surfaces en CAO, Henri GIAUME Peugeot SA . Curves and Surfaces for Computer Aided Geometric Design, a practical guide Gerald Farin

Constructor & Destructor Documentation

◆ Geom2d_BSplineCurve() [1/3]

Geom2d_BSplineCurve::Geom2d_BSplineCurve ( const NCollection_Array1< gp_Pnt2d > & Poles,
const NCollection_Array1< double > & Knots,
const NCollection_Array1< int > & Multiplicities,
const int Degree,
const bool Periodic = false )

Creates a non-rational B_spline curve on the basis <Knots, Multiplicities> of degree <Degree>. The following conditions must be verified. 0 < Degree <= MaxDegree.

Knots.Length() == Mults.Length() >= 2

Knots(i) < Knots(i+1) (Knots are increasing)

1 <= Mults(i) <= Degree

On a non periodic curve the first and last multiplicities may be Degree+1 (this is even recommended if you want the curve to start and finish on the first and last pole).

On a periodic curve the first and the last multicities must be the same.

on non-periodic curves

Poles.Length() == Sum(Mults(i)) - Degree - 1 >= 2

on periodic curves

Poles.Length() == Sum(Mults(i)) except the first or last

◆ Geom2d_BSplineCurve() [2/3]

Geom2d_BSplineCurve::Geom2d_BSplineCurve ( const NCollection_Array1< gp_Pnt2d > & Poles,
const NCollection_Array1< double > & Weights,
const NCollection_Array1< double > & Knots,
const NCollection_Array1< int > & Multiplicities,
const int Degree,
const bool Periodic = false )

Creates a rational B_spline curve on the basis <Knots, Multiplicities> of degree <Degree>. The following conditions must be verified. 0 < Degree <= MaxDegree.

Knots.Length() == Mults.Length() >= 2

Knots(i) < Knots(i+1) (Knots are increasing)

1 <= Mults(i) <= Degree

On a non periodic curve the first and last multiplicities may be Degree+1 (this is even recommended if you want the curve to start and finish on the first and last pole).

On a periodic curve the first and the last multicities must be the same.

on non-periodic curves

Poles.Length() == Sum(Mults(i)) - Degree - 1 >= 2

on periodic curves

Poles.Length() == Sum(Mults(i)) except the first or last

◆ Geom2d_BSplineCurve() [3/3]

Geom2d_BSplineCurve::Geom2d_BSplineCurve ( const Geom2d_BSplineCurve & theOther)

Copy constructor for optimized copying without validation.

Member Function Documentation

◆ ClearEvalRepresentation()

void Geom2d_BSplineCurve::ClearEvalRepresentation ( )
inline

Removes the evaluation representation.

◆ Continuity()

GeomAbs_Shape Geom2d_BSplineCurve::Continuity ( ) const
finalvirtual

Returns the global continuity of the curve : C0 : only geometric continuity, C1 : continuity of the first derivative all along the Curve, C2 : continuity of the second derivative all along the Curve, C3 : continuity of the third derivative all along the Curve, CN : the order of continuity is infinite. For a B-spline curve of degree d if a knot Ui has a multiplicity p the B-spline curve is only Cd-p continuous at Ui. So the global continuity of the curve can't be greater than Cd-p where p is the maximum multiplicity of the interior Knots. In the interior of a knot span the curve is infinitely continuously differentiable.

Implements Geom2d_Curve.

◆ Copy()

occ::handle< Geom2d_Geometry > Geom2d_BSplineCurve::Copy ( ) const
finalvirtual

Creates a new object which is a copy of this BSpline curve.

Implements Geom2d_Geometry.

◆ Degree()

int Geom2d_BSplineCurve::Degree ( ) const

Returns the degree of this BSpline curve. In this class the degree of the basis normalized B-spline functions cannot be greater than "MaxDegree" Computation of value and derivatives.

◆ DumpJson()

void Geom2d_BSplineCurve::DumpJson ( Standard_OStream & theOStream,
int theDepth = -1 ) const
finalvirtual

Dumps the content of me into the stream.

Reimplemented from Geom2d_BoundedCurve.

◆ EndPoint()

gp_Pnt2d Geom2d_BSplineCurve::EndPoint ( ) const
finalvirtual

Returns the last point of the curve. Warnings : The last point of the curve is different from the last pole of the curve if the multiplicity of the last knot is lower than Degree.

Implements Geom2d_BoundedCurve.

◆ EvalD0()

gp_Pnt2d Geom2d_BSplineCurve::EvalD0 ( const double U) const
finalvirtual

Computes the point of parameter U. Raises an exception on failure.

Implements Geom2d_Curve.

◆ EvalD1()

Geom2d_Curve::ResD1 Geom2d_BSplineCurve::EvalD1 ( const double U) const
finalvirtual

Raised if the continuity of the curve is not C1.

Implements Geom2d_Curve.

◆ EvalD2()

Geom2d_Curve::ResD2 Geom2d_BSplineCurve::EvalD2 ( const double U) const
finalvirtual

Raised if the continuity of the curve is not C2.

Implements Geom2d_Curve.

◆ EvalD3()

Geom2d_Curve::ResD3 Geom2d_BSplineCurve::EvalD3 ( const double U) const
finalvirtual

For this BSpline curve, computes.

  • the point P of parameter U, or
  • the point P and one or more of the following values:
  • V1, the first derivative vector,
  • V2, the second derivative vector,
  • V3, the third derivative vector. Warning On a point where the continuity of the curve is not the one requested, these functions impact the part defined by the parameter with a value greater than U, i.e. the part of the curve to the "right" of the singularity. Raises UndefinedDerivative if the continuity of the curve is not C3.

Implements Geom2d_Curve.

◆ EvalDN()

gp_Vec2d Geom2d_BSplineCurve::EvalDN ( const double U,
const int N ) const
finalvirtual

For the point of parameter U of this BSpline curve, computes the vector corresponding to the Nth derivative. Warning On a point where the continuity of the curve is not the one requested, this function impacts the part defined by the parameter with a value greater than U, i.e. the part of the curve to the "right" of the singularity. Raises UndefinedDerivative if the continuity of the curve is not CN. RangeError if N < 1. The following functions computes the point of parameter U and the derivatives at this point on the B-spline curve arc defined between the knot FromK1 and the knot ToK2. U can be out of bounds [Knot (FromK1), Knot (ToK2)] but for the computation we only use the definition of the curve between these two knots. This method is useful to compute local derivative, if the order of continuity of the whole curve is not greater enough. Inside the parametric domain Knot (FromK1), Knot (ToK2) the evaluations are the same as if we consider the whole definition of the curve. Of course the evaluations are different outside this parametric domain.

Implements Geom2d_Curve.

◆ EvalRepresentation()

const occ::handle< Geom2dEval_RepCurveDesc::Base > & Geom2d_BSplineCurve::EvalRepresentation ( ) const
inline

Returns the current evaluation representation descriptor (may be null).

◆ FirstParameter()

double Geom2d_BSplineCurve::FirstParameter ( ) const
finalvirtual

Computes the parametric value of the start point of the curve. It is a knot value.

Implements Geom2d_Curve.

◆ FirstUKnotIndex()

int Geom2d_BSplineCurve::FirstUKnotIndex ( ) const

For a B-spline curve the first parameter (which gives the start point of the curve) is a knot value but if the multiplicity of the first knot index is lower than Degree + 1 it is not the first knot of the curve. This method computes the index of the knot corresponding to the first parameter.

◆ HasEvalRepresentation()

bool Geom2d_BSplineCurve::HasEvalRepresentation ( ) const
inline

Returns true if an evaluation representation is attached.

◆ IncreaseDegree()

void Geom2d_BSplineCurve::IncreaseDegree ( const int Degree)

Increases the degree of this BSpline curve to Degree. As a result, the poles, weights and multiplicities tables are modified; the knots table is not changed. Nothing is done if Degree is less than or equal to the current degree. Exceptions Standard_ConstructionError if Degree is greater than Geom2d_BSplineCurve::MaxDegree().

◆ IncreaseMultiplicity() [1/2]

void Geom2d_BSplineCurve::IncreaseMultiplicity ( const int I1,
const int I2,
const int M )

Increases the multiplicities of the knots in [I1,I2] to <M>.

For each knot if <M> is lower or equal to the current multiplicity nothing is done. If <M> is higher than the degree the degree is used. As a result, the poles and weights tables of this curve are modified. Warning It is forbidden to modify the multiplicity of the first or last knot of a non-periodic curve. Be careful as Geom2d does not protect against this. Exceptions Standard_OutOfRange if either Index, I1 or I2 is outside the bounds of the knots table.

◆ IncreaseMultiplicity() [2/2]

void Geom2d_BSplineCurve::IncreaseMultiplicity ( const int Index,
const int M )

Increases the multiplicity of the knot <Index> to <M>.

If <M> is lower or equal to the current multiplicity nothing is done. If <M> is higher than the degree, the degree is used. If <Index> is not in [FirstUKnotIndex, LastUKnotIndex]

◆ IncrementMultiplicity()

void Geom2d_BSplineCurve::IncrementMultiplicity ( const int I1,
const int I2,
const int M )

Increases by M the multiplicity of the knots of indexes I1 to I2 in the knots table of this BSpline curve. For each knot, the resulting multiplicity is limited to the degree of this curve. If M is negative, nothing is done. As a result, the poles and weights tables of this BSpline curve are modified. Warning It is forbidden to modify the multiplicity of the first or last knot of a non-periodic curve. Be careful as Geom2d does not protect against this. Exceptions Standard_OutOfRange if I1 or I2 is outside the bounds of the knots table.

◆ InsertKnot()

void Geom2d_BSplineCurve::InsertKnot ( const double U,
const int M = 1,
const double ParametricTolerance = 0.0 )

Inserts a knot value in the sequence of knots. If is an existing knot the multiplicity is increased by <M>.

If U is not on the parameter range nothing is done.

If the multiplicity is negative or null nothing is done. The new multiplicity is limited to the degree.

The tolerance criterion for knots equality is the max of Epsilon(U) and ParametricTolerance. Warning

  • If U is less than the first parameter or greater than the last parameter of this BSpline curve, nothing is done.
  • If M is negative or null, nothing is done.
  • The multiplicity of a knot is limited to the degree of this BSpline curve.

◆ InsertKnots()

void Geom2d_BSplineCurve::InsertKnots ( const NCollection_Array1< double > & Knots,
const NCollection_Array1< int > & Mults,
const double ParametricTolerance = 0.0,
const bool Add = false )

Inserts the values of the array Knots, with the respective multiplicities given by the array Mults, into the knots table of this BSpline curve. If a value of the array Knots is an existing knot, its multiplicity is:

  • increased by M, if Add is true, or
  • increased to M, if Add is false (default value). The tolerance criterion used for knot equality is the larger of the values ParametricTolerance (defaulted to 0.) and double::Epsilon(U), where U is the current knot value. Warning
  • For a value of the array Knots which is less than the first parameter or greater than the last parameter of this BSpline curve, nothing is done.
  • For a value of the array Mults which is negative or null, nothing is done.
  • The multiplicity of a knot is limited to the degree of this BSpline curve.

◆ InsertPoleAfter()

void Geom2d_BSplineCurve::InsertPoleAfter ( const int Index,
const gp_Pnt2d & P,
const double Weight = 1.0 )

The new pole is inserted after the pole of range Index. If the curve was non rational it can become rational.

Raised if the B-spline is NonUniform or PiecewiseBezier or if Weight <= 0.0 Raised if Index is not in the range [1, Number of Poles]

◆ InsertPoleBefore()

void Geom2d_BSplineCurve::InsertPoleBefore ( const int Index,
const gp_Pnt2d & P,
const double Weight = 1.0 )

The new pole is inserted before the pole of range Index. If the curve was non rational it can become rational.

Raised if the B-spline is NonUniform or PiecewiseBezier or if Weight <= 0.0 Raised if Index is not in the range [1, Number of Poles]

◆ IsClosed()

bool Geom2d_BSplineCurve::IsClosed ( ) const
finalvirtual

Returns true if the distance between the first point and the last point of the curve is lower or equal to Resolution from package gp. Warnings : The first and the last point can be different from the first pole and the last pole of the curve.

Implements Geom2d_Curve.

◆ IsCN()

bool Geom2d_BSplineCurve::IsCN ( const int N) const
finalvirtual

Returns true if the degree of continuity of this BSpline curve is at least N. A BSpline curve is at least GeomAbs_C0. Exceptions Standard_RangeError if N is negative.

Implements Geom2d_Curve.

◆ IsG1()

bool Geom2d_BSplineCurve::IsG1 ( const double theTf,
const double theTl,
const double theAngTol ) const

Check if curve has at least G1 continuity in interval [theTf, theTl] Returns true if IsCN(1) or angle between "left" and "right" first derivatives at knots with C0 continuity is less then theAngTol only knots in interval [theTf, theTl] is checked.

◆ IsPeriodic()

bool Geom2d_BSplineCurve::IsPeriodic ( ) const
finalvirtual

Returns True if the curve is periodic.

Implements Geom2d_Curve.

◆ IsRational()

bool Geom2d_BSplineCurve::IsRational ( ) const

Returns True if the weights are not identical. The tolerance criterion is Epsilon of the class Real.

◆ Knot()

double Geom2d_BSplineCurve::Knot ( const int Index) const

Returns the knot of range Index. When there is a knot with a multiplicity greater than 1 the knot is not repeated. The method Multiplicity can be used to get the multiplicity of the Knot. Raised if Index < 1 or Index > NbKnots.

◆ KnotDistribution()

GeomAbs_BSplKnotDistribution Geom2d_BSplineCurve::KnotDistribution ( ) const

Returns NonUniform or Uniform or QuasiUniform or PiecewiseBezier. If all the knots differ by a positive constant from the preceding knot the BSpline Curve can be :

  • Uniform if all the knots are of multiplicity 1,
  • QuasiUniform if all the knots are of multiplicity 1 except for the first and last knot which are of multiplicity Degree + 1,
  • PiecewiseBezier if the first and last knots have multiplicity Degree + 1 and if interior knots have multiplicity Degree A piecewise Bezier with only two knots is a BezierCurve. else the curve is non uniform. The tolerance criterion is Epsilon from class Real.

◆ Knots() [1/2]

const NCollection_Array1< double > & Geom2d_BSplineCurve::Knots ( ) const

returns the knot values of the B-spline curve;

◆ Knots() [2/2]

void Geom2d_BSplineCurve::Knots ( NCollection_Array1< double > & K) const

returns the knot values of the B-spline curve;

Raised K.Lower() is less than number of first knot or K.Upper() is more than number of last knot.

Deprecated
("use Knots() returning const reference instead")

◆ KnotSequence() [1/2]

const NCollection_Array1< double > & Geom2d_BSplineCurve::KnotSequence ( ) const

Returns the knots sequence. In this sequence the knots with a multiplicity greater than 1 are repeated. Example : K = {k1, k1, k1, k2, k3, k3, k4, k4, k4}.

◆ KnotSequence() [2/2]

void Geom2d_BSplineCurve::KnotSequence ( NCollection_Array1< double > & K) const

Returns the knots sequence. In this sequence the knots with a multiplicity greater than 1 are repeated. Example : K = {k1, k1, k1, k2, k3, k3, k4, k4, k4}.

Raised if K.Lower() is less than number of first knot in knot sequence with repetitions or K.Upper() is more than number of last knot in knot sequence with repetitions.

Deprecated
("use KnotSequence() returning const reference instead")

◆ LastParameter()

double Geom2d_BSplineCurve::LastParameter ( ) const
finalvirtual

Computes the parametric value of the end point of the curve. It is a knot value.

Implements Geom2d_Curve.

◆ LastUKnotIndex()

int Geom2d_BSplineCurve::LastUKnotIndex ( ) const

For a BSpline curve the last parameter (which gives the end point of the curve) is a knot value but if the multiplicity of the last knot index is lower than Degree + 1 it is not the last knot of the curve. This method computes the index of the knot corresponding to the last parameter.

◆ LocalD0()

void Geom2d_BSplineCurve::LocalD0 ( const double U,
const int FromK1,
const int ToK2,
gp_Pnt2d & P ) const

Raised if FromK1 = ToK2.

◆ LocalD1()

void Geom2d_BSplineCurve::LocalD1 ( const double U,
const int FromK1,
const int ToK2,
gp_Pnt2d & P,
gp_Vec2d & V1 ) const

Raised if the local continuity of the curve is not C1 between the knot K1 and the knot K2. Raised if FromK1 = ToK2.

◆ LocalD2()

void Geom2d_BSplineCurve::LocalD2 ( const double U,
const int FromK1,
const int ToK2,
gp_Pnt2d & P,
gp_Vec2d & V1,
gp_Vec2d & V2 ) const

Raised if the local continuity of the curve is not C2 between the knot K1 and the knot K2. Raised if FromK1 = ToK2.

◆ LocalD3()

void Geom2d_BSplineCurve::LocalD3 ( const double U,
const int FromK1,
const int ToK2,
gp_Pnt2d & P,
gp_Vec2d & V1,
gp_Vec2d & V2,
gp_Vec2d & V3 ) const

Raised if the local continuity of the curve is not C3 between the knot K1 and the knot K2. Raised if FromK1 = ToK2.

◆ LocalDN()

gp_Vec2d Geom2d_BSplineCurve::LocalDN ( const double U,
const int FromK1,
const int ToK2,
const int N ) const

Raised if the local continuity of the curve is not CN between the knot K1 and the knot K2. Raised if FromK1 = ToK2. Raised if N < 1.

◆ LocalValue()

gp_Pnt2d Geom2d_BSplineCurve::LocalValue ( const double U,
const int FromK1,
const int ToK2 ) const

Raised if FromK1 = ToK2.

◆ LocateU()

void Geom2d_BSplineCurve::LocateU ( const double U,
const double ParametricTolerance,
int & I1,
int & I2,
const bool WithKnotRepetition = false ) const

Locates the parametric value U in the sequence of knots. If "WithKnotRepetition" is True we consider the knot's representation with repetition of multiple knot value, otherwise we consider the knot's representation with no repetition of multiple knot values. Knots (I1) <= U <= Knots (I2) . if I1 = I2 U is a knot value (the tolerance criterion ParametricTolerance is used). . if I1 < 1 => U < Knots (1) - std::abs(ParametricTolerance) . if I2 > NbKnots => U > Knots (NbKnots) + std::abs(ParametricTolerance)

◆ MaxDegree()

static int Geom2d_BSplineCurve::MaxDegree ( )
static

Returns the value of the maximum degree of the normalized B-spline basis functions in this package.

◆ MovePoint()

void Geom2d_BSplineCurve::MovePoint ( const double U,
const gp_Pnt2d & P,
const int Index1,
const int Index2,
int & FirstModifiedPole,
int & LastModifiedPole )

Moves the point of parameter U of this BSpline curve to P. Index1 and Index2 are the indexes in the table of poles of this BSpline curve of the first and last poles designated to be moved. FirstModifiedPole and LastModifiedPole are the indexes of the first and last poles, which are effectively modified. In the event of incompatibility between Index1, Index2 and the value U:

  • no change is made to this BSpline curve, and
  • the FirstModifiedPole and LastModifiedPole are returned null. Exceptions Standard_OutOfRange if:
  • Index1 is greater than or equal to Index2, or
  • Index1 or Index2 is less than 1 or greater than the number of poles of this BSpline curve.

◆ MovePointAndTangent()

void Geom2d_BSplineCurve::MovePointAndTangent ( const double U,
const gp_Pnt2d & P,
const gp_Vec2d & Tangent,
const double Tolerance,
const int StartingCondition,
const int EndingCondition,
int & ErrorStatus )

Move a point with parameter U to P. and makes it tangent at U be Tangent. StartingCondition = -1 means first can move EndingCondition = -1 means last point can move StartingCondition = 0 means the first point cannot move EndingCondition = 0 means the last point cannot move StartingCondition = 1 means the first point and tangent cannot move EndingCondition = 1 means the last point and tangent cannot move and so forth ErrorStatus != 0 means that there are not enough degree of freedom with the constrain to deform the curve accordingly.

◆ Multiplicities() [1/2]

const NCollection_Array1< int > & Geom2d_BSplineCurve::Multiplicities ( ) const

returns the multiplicity of the knots of the curve.

◆ Multiplicities() [2/2]

void Geom2d_BSplineCurve::Multiplicities ( NCollection_Array1< int > & M) const

Returns the multiplicity of the knots of the curve.

Raised if the length of M is not equal to NbKnots.

Deprecated
("use Multiplicities() returning const reference instead")

◆ Multiplicity()

int Geom2d_BSplineCurve::Multiplicity ( const int Index) const

Returns the multiplicity of the knots of range Index. Raised if Index < 1 or Index > NbKnots.

◆ NbKnots()

int Geom2d_BSplineCurve::NbKnots ( ) const

Returns the number of knots. This method returns the number of knot without repetition of multiple knots.

◆ NbPoles()

int Geom2d_BSplineCurve::NbPoles ( ) const

Returns the number of poles.

◆ PeriodicNormalization()

void Geom2d_BSplineCurve::PeriodicNormalization ( double & U) const

Computes the parameter normalized within the "first" period of this BSpline curve, if it is periodic: the returned value is in the range Param1 and Param1 + Period, where:

  • Param1 is the "first parameter", and
  • Period the period of this BSpline curve. Note: If this curve is not periodic, U is not modified.

◆ Pole()

const gp_Pnt2d & Geom2d_BSplineCurve::Pole ( const int Index) const

Returns the pole of range Index. Raised if Index < 1 or Index > NbPoles.

◆ Poles() [1/2]

const NCollection_Array1< gp_Pnt2d > & Geom2d_BSplineCurve::Poles ( ) const

Returns the poles of the B-spline curve;.

◆ Poles() [2/2]

void Geom2d_BSplineCurve::Poles ( NCollection_Array1< gp_Pnt2d > & P) const

Returns the poles of the B-spline curve;.

Raised if the length of P is not equal to the number of poles.

Deprecated
("use Poles() returning const reference instead")

◆ RemoveKnot()

bool Geom2d_BSplineCurve::RemoveKnot ( const int Index,
const int M,
const double Tolerance )

Reduces the multiplicity of the knot of index Index to M. If M is equal to 0, the knot is removed. With a modification of this type, the array of poles is also modified. Two different algorithms are systematically used to compute the new poles of the curve. If, for each pole, the distance between the pole calculated using the first algorithm and the same pole calculated using the second algorithm, is less than Tolerance, this ensures that the curve is not modified by more than Tolerance. Under these conditions, true is returned; otherwise, false is returned. A low tolerance is used to prevent modification of the curve. A high tolerance is used to "smooth" the curve. Exceptions Standard_OutOfRange if Index is outside the bounds of the knots table.

◆ RemovePole()

void Geom2d_BSplineCurve::RemovePole ( const int Index)

Removes the pole of range Index If the curve was rational it can become non rational.

Raised if the B-spline is NonUniform or PiecewiseBezier. Raised if the number of poles of the B-spline curve is lower or equal to 2 before removing. Raised if Index is not in the range [1, Number of Poles]

◆ Resolution()

void Geom2d_BSplineCurve::Resolution ( const double ToleranceUV,
double & UTolerance )

Computes for this BSpline curve the parametric tolerance UTolerance for a given tolerance Tolerance3D (relative to dimensions in the plane). If f(t) is the equation of this BSpline curve, UTolerance ensures that: | t1 - t0| < Utolerance ===> |f(t1) - f(t0)| < ToleranceUV.

◆ Reverse()

void Geom2d_BSplineCurve::Reverse ( )
finalvirtual

Reverses the orientation of this BSpline curve. As a result.

  • the knots and poles tables are modified;
  • the start point of the initial curve becomes the end point of the reversed curve;
  • the end point of the initial curve becomes the start point of the reversed curve.

Implements Geom2d_Curve.

◆ ReversedParameter()

double Geom2d_BSplineCurve::ReversedParameter ( const double U) const
finalvirtual

Computes the parameter on the reversed curve for the point of parameter U on this BSpline curve. The returned value is: UFirst + ULast - U, where UFirst and ULast are the values of the first and last parameters of this BSpline curve.

Implements Geom2d_Curve.

◆ Segment()

void Geom2d_BSplineCurve::Segment ( const double U1,
const double U2,
const double theTolerance = Precision::PConfusion() )

Modifies this BSpline curve by segmenting it between U1 and U2. Either of these values can be outside the bounds of the curve, but U2 must be greater than U1. All data structure tables of this BSpline curve are modified, but the knots located between U1 and U2 are retained. The degree of the curve is not modified.

Parameter theTolerance defines the possible proximity of the segment boundaries and B-spline knots to treat them as equal.

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.

  • The segmentation of a periodic curve over an interval corresponding to its period generates a non-periodic curve with equivalent geometry. Exceptions Standard_DomainError if U2 is less than U1. raises if U2 < U1. Standard_DomainError if U2 - U1 exceeds the period for periodic curves. i.e. ((U2 - U1) - Period) > Precision::PConfusion().

◆ SetEvalRepresentation()

void Geom2d_BSplineCurve::SetEvalRepresentation ( const occ::handle< Geom2dEval_RepCurveDesc::Base > & theDesc)

Sets a new evaluation representation. Validates descriptor data and ensures no circular references.

◆ SetKnot() [1/2]

void Geom2d_BSplineCurve::SetKnot ( const int Index,
const double K )

Modifies this BSpline curve by assigning the value K to the knot of index Index in the knots table. This is a relatively local modification because K must be such that: Knots(Index - 1) < K < Knots(Index + 1) Exceptions Standard_ConstructionError if:

  • K is not such that: Knots(Index - 1) < K < Knots(Index + 1)
  • M is greater than the degree of this BSpline curve or lower than the previous multiplicity of knot of index Index in the knots table. Standard_OutOfRange if Index is outside the bounds of the knots table.

◆ SetKnot() [2/2]

void Geom2d_BSplineCurve::SetKnot ( const int Index,
const double K,
const int M )

Modifies this BSpline curve by assigning the value K to the knot of index Index in the knots table. This is a relatively local modification because K must be such that: Knots(Index - 1) < K < Knots(Index + 1) The second syntax allows you also to increase the multiplicity of the knot to M (but it is not possible to decrease the multiplicity of the knot with this function). Exceptions Standard_ConstructionError if:

  • K is not such that: Knots(Index - 1) < K < Knots(Index + 1)
  • M is greater than the degree of this BSpline curve or lower than the previous multiplicity of knot of index Index in the knots table. Standard_OutOfRange if Index is outside the bounds of the knots table.

◆ SetKnots()

void Geom2d_BSplineCurve::SetKnots ( const NCollection_Array1< double > & K)

Modifies this BSpline curve by assigning the array K to its knots table. The multiplicity of the knots is not modified. Exceptions Standard_ConstructionError if the values in the array K are not in ascending order. Standard_OutOfRange if the bounds of the array K are not respectively 1 and the number of knots of this BSpline curve.

◆ SetNotPeriodic()

void Geom2d_BSplineCurve::SetNotPeriodic ( )

Changes this BSpline curve into a non-periodic curve. If this curve is already non-periodic, it is not modified. Note that the poles and knots tables are modified. Warning If this curve is periodic, as the multiplicity of the first and last knots is not modified, and is not equal to Degree + 1, where Degree is the degree of this BSpline curve, the start and end points of the curve are not its first and last poles.

◆ SetOrigin()

void Geom2d_BSplineCurve::SetOrigin ( const int Index)

Assigns the knot of index Index in the knots table as the origin of this periodic BSpline curve. As a consequence, the knots and poles tables are modified. Exceptions Standard_NoSuchObject if this curve is not periodic. Standard_DomainError if Index is outside the bounds of the knots table.

◆ SetPeriodic()

void Geom2d_BSplineCurve::SetPeriodic ( )

Changes this BSpline curve into a periodic curve. To become periodic, the curve must first be closed. Next, the knot sequence must be periodic. For this, FirstUKnotIndex and LastUKnotIndex are used to compute I1 and I2, the indexes in the knots array of the knots corresponding to the first and last parameters of this BSpline curve. The period is therefore Knot(I2) - Knot(I1). Consequently, the knots and poles tables are modified. Exceptions Standard_ConstructionError if this BSpline curve is not closed.

◆ SetPole() [1/2]

void Geom2d_BSplineCurve::SetPole ( const int Index,
const gp_Pnt2d & P )

Modifies this BSpline curve by assigning P to the pole of index Index in the poles table. Exceptions Standard_OutOfRange if Index is outside the bounds of the poles table. Standard_ConstructionError if Weight is negative or null.

◆ SetPole() [2/2]

void Geom2d_BSplineCurve::SetPole ( const int Index,
const gp_Pnt2d & P,
const double Weight )

Modifies this BSpline curve by assigning P to the pole of index Index in the poles table. The second syntax also allows you to modify the weight of the modified pole, which becomes Weight. In this case, if this BSpline curve is non-rational, it can become rational and vice versa. Exceptions Standard_OutOfRange if Index is outside the bounds of the poles table. Standard_ConstructionError if Weight is negative or null.

◆ SetWeight()

void Geom2d_BSplineCurve::SetWeight ( const int Index,
const double Weight )

Assigns the weight Weight to the pole of index Index of the poles table. If the curve was non rational it can become rational. If the curve was rational it can become non rational. Exceptions Standard_OutOfRange if Index is outside the bounds of the poles table. Standard_ConstructionError if Weight is negative or null.

◆ StartPoint()

gp_Pnt2d Geom2d_BSplineCurve::StartPoint ( ) const
finalvirtual

Returns the start point of the curve. Warnings : This point is different from the first pole of the curve if the multiplicity of the first knot is lower than Degree.

Implements Geom2d_BoundedCurve.

◆ Transform()

void Geom2d_BSplineCurve::Transform ( const gp_Trsf2d & T)
finalvirtual

Applies the transformation T to this BSpline curve.

Implements Geom2d_Geometry.

◆ updateKnots()

void Geom2d_BSplineCurve::updateKnots ( )
protected

Recompute the flatknots, the knotsdistribution, the continuity.

◆ Weight()

double Geom2d_BSplineCurve::Weight ( const int Index) const

Returns the weight of the pole of range Index . Raised if Index < 1 or Index > NbPoles.

◆ Weights() [1/2]

const NCollection_Array1< double > * Geom2d_BSplineCurve::Weights ( ) const

Returns the weights of the B-spline curve;.

◆ Weights() [2/2]

void Geom2d_BSplineCurve::Weights ( NCollection_Array1< double > & W) const

Returns the weights of the B-spline curve;.

Raised if the length of W is not equal to NbPoles.

Deprecated
("use Weights() returning const pointer instead")

◆ WeightsArray()

const NCollection_Array1< double > & Geom2d_BSplineCurve::WeightsArray ( ) const
inline

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().

Warning
Do NOT modify elements through the returned reference.

The documentation for this class was generated from the following file: