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

Definition of the 1D B_spline curve. More...

#include <Law_BSpline.hxx>

Inheritance diagram for Law_BSpline:
Inheritance graph
[legend]

Public Member Functions

 Law_BSpline (const NCollection_Array1< double > &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>.
 
 Law_BSpline (const NCollection_Array1< double > &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>.
 
void IncreaseDegree (const int Degree)
 Increase the degree to <Degree>. Nothing is done if <Degree> is lower or equal to the current degree.
 
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)
 Increment the multiplicities of the knots in [I1,I2] by <M>.
 
void InsertKnot (const double U, const int M=1, const double ParametricTolerance=0.0, const bool Add=true)
 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 a set of knots values in the sequence of knots.
 
bool RemoveKnot (const int Index, const int M, const double Tolerance)
 Decrement the knots multiplicity to <M>. If M is 0 the knot is removed. The Poles sequence is modified.
 
void Reverse ()
 Changes the direction of parametrization of <me>. The Knot sequence is modified, the FirstParameter and the LastParameter are not modified. The StartPoint of the initial curve becomes the EndPoint of the reversed curve and the EndPoint of the initial curve becomes the StartPoint of the reversed curve.
 
double ReversedParameter (const double U) const
 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. The control points are modified, the first and the last point are not the same. 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. raises if U2 < U1.
 
void SetKnot (const int Index, const double K)
 Changes the knot of range Index. The multiplicity of the knot is not modified. Raised if K >= Knots(Index+1) or K <= Knots(Index-1). Raised if Index < 1 || Index > NbKnots.
 
void SetKnots (const NCollection_Array1< double > &K)
 Changes all the knots of the curve The multiplicity of the knots are not modified.
 
void SetKnot (const int Index, const double K, const int M)
 Changes the knot of range Index with its multiplicity. You can increase the multiplicity of a knot but it is not allowed to decrease the multiplicity of an existing knot.
 
void PeriodicNormalization (double &U) const
 returns the parameter normalized within the period if the curve is periodic : otherwise does not do anything
 
void SetPeriodic ()
 Makes a closed B-spline into a periodic curve. The curve is periodic if the knot sequence is periodic and if the curve is closed (The tolerance criterion is Resolution from gp). The period T is equal to Knot(LastUKnotIndex) - Knot(FirstUKnotIndex). A periodic B-spline can be uniform or not. Raised if the curve is not closed.
 
void SetOrigin (const int Index)
 Set the origin of a periodic curve at Knot(index) KnotVector and poles are modified. Raised if the curve is not periodic Raised if index not in the range [FirstUKnotIndex , LastUKnotIndex].
 
void SetNotPeriodic ()
 Makes a non periodic curve. If the curve was non periodic the curve is not modified.
 
void SetPole (const int Index, const double P)
 Substitutes the Pole of range Index with P.
 
void SetPole (const int Index, const double P, const double Weight)
 Substitutes the pole and the weight of range Index. If the curve <me> is not rational it can become rational If the curve was rational it can become non rational.
 
void SetWeight (const int Index, const double Weight)
 Changes the weight for the pole of range Index. If the curve was non rational it can become rational. If the curve was rational it can become non rational.
 
bool IsCN (const int N) const
 Returns the continuity of the curve, the curve is at least C0. Raised if N < 0.
 
bool IsClosed () const
 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
 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
 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
 Computation of value and derivatives.
 
double Value (const double U) const
 
void D0 (const double U, double &P) const
 
void D1 (const double U, double &P, double &V1) const
 
void D2 (const double U, double &P, double &V1, double &V2) const
 
void D3 (const double U, double &P, double &V1, double &V2, double &V3) const
 
double DN (const double U, const int N) const
 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.
 
double LocalValue (const double U, const int FromK1, const int ToK2) const
 
void LocalD0 (const double U, const int FromK1, const int ToK2, double &P) const
 
void LocalD1 (const double U, const int FromK1, const int ToK2, double &P, double &V1) const
 
void LocalD2 (const double U, const int FromK1, const int ToK2, double &P, double &V1, double &V2) const
 
void LocalD3 (const double U, const int FromK1, const int ToK2, double &P, double &V1, double &V2, double &V3) const
 
double LocalDN (const double U, const int FromK1, const int ToK2, const int N) const
 
double EndPoint () const
 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
 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;
 
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}.
 
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
 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.
 
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.
 
double Pole (const int Index) const
 Returns the pole of range Index. Raised if Index < 1 or Index > NbPoles.
 
void Poles (NCollection_Array1< double > &P) const
 Returns the poles of the B-spline curve;.
 
double StartPoint () const
 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;.
 
void MovePointAndTangent (const double U, const double NewValue, const double Derivative, const double Tolerance, const int StartingCondition, const int EndingCondition, int &ErrorStatus)
 Changes the value of the Law at parameter U to NewValue. and makes its derivative at U be derivative. 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.
 
void Resolution (const double Tolerance3D, double &UTolerance) const
 given Tolerance3D returns UTolerance such that if f(t) is the curve we have | t1 - t0| < Utolerance ===> |f(t1) - f(t0)| < Tolerance3D
 
occ::handle< Law_BSplineCopy () 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.
 

Additional Inherited Members

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

Detailed Description

Definition of the 1D B_spline curve.

Uniform or non-uniform Rational or non-rational Periodic or non-periodic

A b-spline curve is defined by:

The Degree (up to 25)

The Poles (and the weights if it is rational)

The Knots and Multiplicities

The knot vector is an increasing sequence of reals without repetition. The multiplicities are the repetition of the knots.

If the knots are regularly spaced (the difference of two consecutive knots is a constant), the knots repartition is:

The curve may be periodic.

On a periodic curve if there are k knots and p poles. the period is knot(k) - knot(1)

the poles and knots are infinite vectors with:

knot(i+k) = knot(i) + period

pole(i+p) = pole(i)

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

◆ Law_BSpline() [1/2]

Law_BSpline::Law_BSpline ( const NCollection_Array1< double > & 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>.

◆ Law_BSpline() [2/2]

Law_BSpline::Law_BSpline ( const NCollection_Array1< double > & 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>.

Member Function Documentation

◆ Continuity()

GeomAbs_Shape Law_BSpline::Continuity ( ) const

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.

◆ Copy()

occ::handle< Law_BSpline > Law_BSpline::Copy ( ) const

◆ D0()

void Law_BSpline::D0 ( const double U,
double & P ) const

◆ D1()

void Law_BSpline::D1 ( const double U,
double & P,
double & V1 ) const

◆ D2()

void Law_BSpline::D2 ( const double U,
double & P,
double & V1,
double & V2 ) const

◆ D3()

void Law_BSpline::D3 ( const double U,
double & P,
double & V1,
double & V2,
double & V3 ) const

◆ Degree()

int Law_BSpline::Degree ( ) const

Computation of value and derivatives.

◆ DN()

double Law_BSpline::DN ( const double U,
const int N ) const

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.

◆ EndPoint()

double Law_BSpline::EndPoint ( ) const

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.

◆ FirstParameter()

double Law_BSpline::FirstParameter ( ) const

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

◆ FirstUKnotIndex()

int Law_BSpline::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.

◆ IncreaseDegree()

void Law_BSpline::IncreaseDegree ( const int Degree)

Increase the degree to <Degree>. Nothing is done if <Degree> is lower or equal to the current degree.

◆ IncreaseMultiplicity() [1/2]

void Law_BSpline::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. If <I1,I2> are not in [FirstUKnotIndex, LastUKnotIndex]

◆ IncreaseMultiplicity() [2/2]

void Law_BSpline::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 Law_BSpline::IncrementMultiplicity ( const int I1,
const int I2,
const int M )

Increment the multiplicities of the knots in [I1,I2] by <M>.

If <M> is not positive nothing is done.

For each knot the resulting multiplicity is limited to the Degree. If <I1,I2> are not in [FirstUKnotIndex, LastUKnotIndex]

◆ InsertKnot()

void Law_BSpline::InsertKnot ( const double U,
const int M = 1,
const double ParametricTolerance = 0.0,
const bool Add = true )

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.

◆ InsertKnots()

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

Inserts a set of knots values in the sequence of knots.

For each U = Knots(i), M = Mults(i)

If is an existing knot the multiplicity is increased by <M> if <Add> is True, increased to <M> if <Add> is False.

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.

◆ IsClosed()

bool Law_BSpline::IsClosed ( ) const

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.

◆ IsCN()

bool Law_BSpline::IsCN ( const int N) const

Returns the continuity of the curve, the curve is at least C0. Raised if N < 0.

◆ IsPeriodic()

bool Law_BSpline::IsPeriodic ( ) const

Returns True if the curve is periodic.

◆ IsRational()

bool Law_BSpline::IsRational ( ) const

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

◆ Knot()

double Law_BSpline::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 Law_BSpline::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()

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

returns the knot values of the B-spline curve;

Raised if the length of K is not equal to the number of knots.

◆ KnotSequence()

void Law_BSpline::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 the length of K is not equal to NbPoles + Degree + 1

◆ LastParameter()

double Law_BSpline::LastParameter ( ) const

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

◆ LastUKnotIndex()

int Law_BSpline::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 Law_BSpline::LocalD0 ( const double U,
const int FromK1,
const int ToK2,
double & P ) const

◆ LocalD1()

void Law_BSpline::LocalD1 ( const double U,
const int FromK1,
const int ToK2,
double & P,
double & V1 ) const

◆ LocalD2()

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

◆ LocalD3()

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

◆ LocalDN()

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

◆ LocalValue()

double Law_BSpline::LocalValue ( const double U,
const int FromK1,
const int ToK2 ) const

◆ LocateU()

void Law_BSpline::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 Law_BSpline::MaxDegree ( )
static

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

◆ MovePointAndTangent()

void Law_BSpline::MovePointAndTangent ( const double U,
const double NewValue,
const double Derivative,
const double Tolerance,
const int StartingCondition,
const int EndingCondition,
int & ErrorStatus )

Changes the value of the Law at parameter U to NewValue. and makes its derivative at U be derivative. 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()

void Law_BSpline::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.

◆ Multiplicity()

int Law_BSpline::Multiplicity ( const int Index) const

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

◆ NbKnots()

int Law_BSpline::NbKnots ( ) const

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

◆ NbPoles()

int Law_BSpline::NbPoles ( ) const

Returns the number of poles.

◆ PeriodicNormalization()

void Law_BSpline::PeriodicNormalization ( double & U) const

returns the parameter normalized within the period if the curve is periodic : otherwise does not do anything

◆ Pole()

double Law_BSpline::Pole ( const int Index) const

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

◆ Poles()

void Law_BSpline::Poles ( NCollection_Array1< double > & P) const

Returns the poles of the B-spline curve;.

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

◆ RemoveKnot()

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

Decrement the knots multiplicity to <M>. If M is 0 the knot is removed. The Poles sequence is modified.

As there are two ways to compute the new poles the average is computed if the distance is lower than the <Tolerance>, else False is returned.

A low tolerance is used to prevent the modification of the curve.

A high tolerance is used to "smooth" the curve.

Raised if Index is not in the range [FirstUKnotIndex, LastUKnotIndex] pole insertion and pole removing this operation is limited to the Uniform or QuasiUniform BSplineCurve. The knot values are modified. If the BSpline is NonUniform or Piecewise Bezier an exception Construction error is raised.

◆ Resolution()

void Law_BSpline::Resolution ( const double Tolerance3D,
double & UTolerance ) const

given Tolerance3D returns UTolerance such that if f(t) is the curve we have | t1 - t0| < Utolerance ===> |f(t1) - f(t0)| < Tolerance3D

◆ Reverse()

void Law_BSpline::Reverse ( )

Changes the direction of parametrization of <me>. The Knot sequence is modified, the FirstParameter and the LastParameter are not modified. The StartPoint of the initial curve becomes the EndPoint of the reversed curve and the EndPoint of the initial curve becomes the StartPoint of the reversed curve.

◆ ReversedParameter()

double Law_BSpline::ReversedParameter ( const double U) const

Returns the parameter on the reversed curve for the point of parameter U on <me>.

returns UFirst + ULast - U

◆ Segment()

void Law_BSpline::Segment ( const double U1,
const double U2 )

Segments the curve between U1 and U2. The control points are modified, the first and the last point are not the same. 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. raises if U2 < U1.

◆ SetKnot() [1/2]

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

Changes the knot of range Index. The multiplicity of the knot is not modified. Raised if K >= Knots(Index+1) or K <= Knots(Index-1). Raised if Index < 1 || Index > NbKnots.

◆ SetKnot() [2/2]

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

Changes the knot of range Index with its multiplicity. You can increase the multiplicity of a knot but it is not allowed to decrease the multiplicity of an existing knot.

Raised if K >= Knots(Index+1) or K <= Knots(Index-1). Raised if M is greater than Degree or lower than the previous multiplicity of knot of range Index. Raised if Index < 1 || Index > NbKnots

◆ SetKnots()

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

Changes all the knots of the curve The multiplicity of the knots are not modified.

Raised if there is an index such that K (Index+1) <= K (Index).

Raised if K.Lower() < 1 or K.Upper() > NbKnots

◆ SetNotPeriodic()

void Law_BSpline::SetNotPeriodic ( )

Makes a non periodic curve. If the curve was non periodic the curve is not modified.

◆ SetOrigin()

void Law_BSpline::SetOrigin ( const int Index)

Set the origin of a periodic curve at Knot(index) KnotVector and poles are modified. Raised if the curve is not periodic Raised if index not in the range [FirstUKnotIndex , LastUKnotIndex].

◆ SetPeriodic()

void Law_BSpline::SetPeriodic ( )

Makes a closed B-spline into a periodic curve. The curve is periodic if the knot sequence is periodic and if the curve is closed (The tolerance criterion is Resolution from gp). The period T is equal to Knot(LastUKnotIndex) - Knot(FirstUKnotIndex). A periodic B-spline can be uniform or not. Raised if the curve is not closed.

◆ SetPole() [1/2]

void Law_BSpline::SetPole ( const int Index,
const double P )

Substitutes the Pole of range Index with P.

Raised if Index < 1 || Index > NbPoles

◆ SetPole() [2/2]

void Law_BSpline::SetPole ( const int Index,
const double P,
const double Weight )

Substitutes the pole and the weight of range Index. If the curve <me> is not rational it can become rational If the curve was rational it can become non rational.

Raised if Index < 1 || Index > NbPoles Raised if Weight <= 0.0

◆ SetWeight()

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

Changes the weight for the pole of range Index. If the curve was non rational it can become rational. If the curve was rational it can become non rational.

Raised if Index < 1 || Index > NbPoles Raised if Weight <= 0.0

◆ StartPoint()

double Law_BSpline::StartPoint ( ) const

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.

◆ Value()

double Law_BSpline::Value ( const double U) const

◆ Weight()

double Law_BSpline::Weight ( const int Index) const

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

◆ Weights()

void Law_BSpline::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.


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