OpenCascade.js
API ReferenceModelingAlgorithmsTKGeomAlgo

Law

OCCT package Law: Law, Law_BSpFunc, Law_BSpline, Law_BSplineKnotSplitting, and 7 more bound classes.

Law

Multiple services concerning 1d functions.

Constructors(1)

Static methods(6)

  • This algorithm searches the knot values corresponding to the splitting of a given B-spline law into several arcs with the same continuity. The continuity order is given at the construction time. Builds a 1d bspline that is near from Lin with null derivatives at the extremities.

    Parameters (1)
    • Lin
  • Builds the poles of the 1d bspline that is near from Lin with null derivatives at the extremities.

    Parameters (4)
    • Degree
    • Knots
    • Mults
    • Lin
  • MixTgt(Degree: number, Knots: NCollection_Array1_double, Mults: NCollection_Array1_int, NulOnTheRight: boolean, Index: number): NCollection_HArray1_double

    Builds the poles of the 1d bspline that is null on the right side of Knots(Index) (on the left if NulOnTheRight is false) and that is like a t*(1-t)(1-t) curve on the left side of Knots(Index) (on the right if NulOnTheRight is false). The result curve is C1 with a derivative equal to 1. at first parameter (-1 at last parameter if NulOnTheRight is false). Warning: Mults(Index) must greater or equal to degree-1.

    Parameters (5)
    • Degree
    • Knots
    • Mults
    • NulOnTheRight
    • Index
  • Reparametrize(Curve: Adaptor3d_Curve, First: number, Last: number, HasDF: boolean, HasDL: boolean, DFirst: number, DLast: number, Rev: boolean, NbPoints: number): Law_BSpline

    Computes a 1d curve to reparametrize a curve. Its an interpolation of NbPoints points calculated at quasi constant abscissa.

    Parameters (9)
    • Curve
    • First
    • Last
    • HasDF
    • HasDL
    • DFirst
    • DLast
    • Rev
    • NbPoints
  • Scale(First: number, Last: number, HasF: boolean, HasL: boolean, VFirst: number, VLast: number): Law_BSpline

    Computes a 1d curve to scale a field of tangency. Value is 1. for t = (First+Last)/2 . If HasFirst value for t = First is VFirst (null derivative). If HasLast value for t = Last is VLast (null derivative).

    1. _ _/ _ __/ __ / VFirst ____/ VLast ____ First Last
    Parameters (6)
    • First
    • Last
    • HasF
    • HasL
    • VFirst
    • VLast
  • ScaleCub(First: number, Last: number, HasF: boolean, HasL: boolean, VFirst: number, VLast: number): Law_BSpline
    Parameters (6)
    • First
    • Last
    • HasF
    • HasL
    • VFirst
    • VLast

Law_BSpFunc

Law Function based on a BSpline curve 1d. Package methods and classes are implemented in package Law to construct the basis curve with several constraints.

Constructors(2)

Static methods(2)

Instance methods(11)

  • Returns the number of intervals for continuity . May be one if Continuity(me) >= .

    Parameters (1)
    • S
  • Stores in <T> the parameters bounding the intervals of continuity . The array must provide enough room to accommodate for the parameters, i.e. T.Length() > NbIntervals().

    Parameters (2)
    • T
      Mutated in place; read the updated value from this argument after the call.
    • S
  • Value(X: number): number

    Returns the value of the function at the point of parameter X.

    Parameters (1)
    • X
  • D1(X: number, F: number, D: number): { F: number; D: number }

    Returns the value F and the first derivative D of the function at the point of parameter X.

    Parameters (3)
    • X
    • F
    • D
    Returns

    A result object with fields:

    • F: updated value from the call.
    • D: updated value from the call.
  • D2(X: number, F: number, D: number, D2: number): { F: number; D: number; D2: number }

    Returns the value, first and second derivatives at parameter X.

    Parameters (4)
    • X
    • F
    • D
    • D2
    Returns

    A result object with fields:

    • F: updated value from the call.
    • D: updated value from the call.
    • D2: updated value from the call.
  • Trim(PFirst: number, PLast: number, Tol: number): Law_Function

    Returns a law equivalent of <me> between parameters <First> and <Last>. <Tol> is used to test for 3d points confusion. It is usfule to determines the derivatives in these values <First> and <Last> if the Law is not Cn.

    Parameters (3)
    • PFirst
    • PLast
    • Tol
  • Bounds(PFirst: number, PLast: number): { PFirst: number; PLast: number }

    Returns the parametric bounds of the function.

    Parameters (2)
    • PFirst
    • PLast
    Returns

    A result object with fields:

    • PFirst: updated value from the call.
    • PLast: updated value from the call.
  • Parameters (1)
    • C

Law_BSpline

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:

  • Uniform if all multiplicities are 1.
  • Quasi-uniform if all multiplicities are 1 but the first and the last which are Degree+1.
  • PiecewiseBezier if all multiplicities are Degree but the first and the last which are Degree+1.
    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

Constructors(2)

Static methods(3)

Instance methods(61)

  • IncreaseDegree(Degree: number): void

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

    Parameters (1)
    • Degree
  • IncreaseMultiplicity(Index: number, M: number): void

    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]

    Parameters (2)
    • Index
    • M
  • IncreaseMultiplicity(I1: number, I2: number, M: number): void

    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]

    Parameters (3)
    • I1
    • I2
    • M
  • IncrementMultiplicity(I1: number, I2: number, M: number): void

    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]

    Parameters (3)
    • I1
    • I2
    • M
  • InsertKnot(U: number, M?: number, ParametricTolerance?: number, Add?: boolean): void

    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.

    Parameters (4)
    • U
    • M
    • ParametricTolerance
    • Add
  • InsertKnots(Knots: NCollection_Array1_double, Mults: NCollection_Array1_int, ParametricTolerance?: number, Add?: boolean): void

    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.

    Parameters (4)
    • Knots
    • Mults
    • ParametricTolerance
    • Add
  • RemoveKnot(Index: number, M: number, Tolerance: number): boolean

    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.

    Parameters (3)
    • Index
    • M
    • Tolerance
  • Reverse(): void

    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(U: number): number

    Returns the parameter on the reversed curve for the point of parameter U on <me>.
    returns UFirst + ULast - U

    Parameters (1)
    • U
  • Segment(U1: number, U2: number): void

    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.

    Parameters (2)
    • U1
    • U2
  • SetKnot(Index: number, K: number): void

    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.

    Parameters (2)
    • Index
    • K
  • SetKnot(Index: number, K: number, M: number): void

    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

    Parameters (3)
    • Index
    • K
    • M
  • 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

    Parameters (1)
    • K
  • PeriodicNormalization(U: number): { U: number }

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

    Parameters (1)
    • U
    Returns

    A result object with fields:

    • U: updated value from the call.
  • SetPeriodic(): void

    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.

  • SetOrigin(Index: number): void

    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].

    Parameters (1)
    • Index
  • Makes a non periodic curve. If the curve was non periodic the curve is not modified.

  • SetPole(Index: number, P: number): void

    Substitutes the Pole of range Index with P.
    Raised if Index < 1 || Index > NbPoles

    Parameters (2)
    • Index
    • P
  • SetPole(Index: number, P: number, Weight: number): void

    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

    Parameters (3)
    • Index
    • P
    • Weight
  • SetWeight(Index: number, Weight: number): void

    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

    Parameters (2)
    • Index
    • Weight
  • IsCN(N: number): boolean

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

    Parameters (1)
    • N
  • IsClosed(): boolean

    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.

  • IsPeriodic(): boolean

    Returns True if the curve is periodic.

  • IsRational(): boolean

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

  • 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.

  • Degree(): number

    Computation of value and derivatives.

  • Value(U: number): number
    Parameters (1)
    • U
  • D0(U: number, P: number): { P: number }
    Parameters (2)
    • U
    • P
  • D1(U: number, P: number, V1: number): { P: number; V1: number }
    Parameters (3)
    • U
    • P
    • V1
  • D2(U: number, P: number, V1: number, V2: number): { P: number; V1: number; V2: number }
    Parameters (4)
    • U
    • P
    • V1
    • V2
  • D3(U: number, P: number, V1: number, V2: number, V3: number): { P: number; V1: number; V2: number; V3: number }
    Parameters (5)
    • U
    • P
    • V1
    • V2
    • V3
  • DN(U: number, N: number): number

    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.

    Parameters (2)
    • U
    • N
  • LocalValue(U: number, FromK1: number, ToK2: number): number
    Parameters (3)
    • U
    • FromK1
    • ToK2
  • LocalD0(U: number, FromK1: number, ToK2: number, P: number): { P: number }
    Parameters (4)
    • U
    • FromK1
    • ToK2
    • P
  • LocalD1(U: number, FromK1: number, ToK2: number, P: number, V1: number): { P: number; V1: number }
    Parameters (5)
    • U
    • FromK1
    • ToK2
    • P
    • V1
  • LocalD2(U: number, FromK1: number, ToK2: number, P: number, V1: number, V2: number): { P: number; V1: number; V2: number }
    Parameters (6)
    • U
    • FromK1
    • ToK2
    • P
    • V1
    • V2
  • LocalD3(U: number, FromK1: number, ToK2: number, P: number, V1: number, V2: number, V3: number): { P: number; V1: number; V2: number; V3: number }
    Parameters (7)
    • U
    • FromK1
    • ToK2
    • P
    • V1
    • V2
    • V3
  • LocalDN(U: number, FromK1: number, ToK2: number, N: number): number
    Parameters (4)
    • U
    • FromK1
    • ToK2
    • N
  • EndPoint(): number

    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.

  • FirstUKnotIndex(): number

    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.

  • FirstParameter(): number

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

  • Knot(Index: number): number

    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.

    Parameters (1)
    • Index
  • returns the knot values of the B-spline curve;
    Raised if the length of K is not equal to the number of knots.

    Parameters (1)
    • K
      Mutated in place; read the updated value from this argument after the call.
  • 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

    Parameters (1)
    • K
      Mutated in place; read the updated value from this argument after the call.
  • 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.
  • LastUKnotIndex(): number

    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.

  • LastParameter(): number

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

  • LocateU(U: number, ParametricTolerance: number, I1: number, I2: number, WithKnotRepetition: boolean): { I1: number; I2: number }

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

    Parameters (5)
    • U
    • ParametricTolerance
    • I1
    • I2
    • WithKnotRepetition
    Returns

    A result object with fields:

    • I1: updated value from the call.
    • I2: updated value from the call.
  • Multiplicity(Index: number): number

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

    Parameters (1)
    • Index
  • Returns the multiplicity of the knots of the curve.
    Raised if the length of M is not equal to NbKnots.

    Parameters (1)
    • M
      Mutated in place; read the updated value from this argument after the call.
  • NbKnots(): number

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

  • NbPoles(): number

    Returns the number of poles.

  • Pole(Index: number): number

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

    Parameters (1)
    • Index
  • Returns the poles of the B-spline curve;.
    Raised if the length of P is not equal to the number of poles.

    Parameters (1)
    • P
      Mutated in place; read the updated value from this argument after the call.
  • StartPoint(): number

    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.

  • Weight(Index: number): number

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

    Parameters (1)
    • Index
  • Returns the weights of the B-spline curve;.
    Raised if the length of W is not equal to NbPoles.

    Parameters (1)
    • W
      Mutated in place; read the updated value from this argument after the call.
  • MovePointAndTangent(U: number, NewValue: number, Derivative: number, Tolerance: number, StartingCondition: number, EndingCondition: number, ErrorStatus: number): { ErrorStatus: number }

    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.

    Parameters (7)
    • U
    • NewValue
    • Derivative
    • Tolerance
    • StartingCondition
    • EndingCondition
    • ErrorStatus
    Returns

    A result object with fields:

    • ErrorStatus: updated value from the call.
  • Resolution(Tolerance3D: number, UTolerance: number): { UTolerance: number }

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

    Parameters (2)
    • Tolerance3D
    • UTolerance
    Returns

    A result object with fields:

    • UTolerance: updated value from the call.

Law_BSplineKnotSplitting

For a B-spline curve the discontinuities are localised at the knot values and between two knots values the B-spline is infinitely continuously differentiable.
At a knot of range index the continuity is equal to: Degree - Mult (Index) where Degree is the degree of the basis B-spline functions and Mult the multiplicity of the knot of range Index.
If for your computation you need to have B-spline curves with a minima of continuity it can be interesting to know between which knot values, a B-spline curve arc, has a continuity of given order.
This algorithm computes the indexes of the knots where you should split the curve, to obtain arcs with a constant continuity given at the construction time. The splitting values are in the range [FirstUKnotValue, LastUKnotValue] (See class B-spline curve from package Geom).
If you just want to compute the local derivatives on the curve you don't need to create the B-spline curve arcs, you can use the functions LocalD1, LocalD2, LocalD3, LocalDN of the class BSplineCurve.

Constructors(1)

  • constructor(BasisLaw: Law_BSpline, ContinuityRange: number): Law_BSplineKnotSplitting

    Locates the knot values which correspond to the segmentation of the curve into arcs with a continuity equal to ContinuityRange.
    Raised if ContinuityRange is not greater or equal zero.

    Parameters (2)
    • BasisLaw
    • ContinuityRange

Instance methods(3)

  • NbSplits(): number

    Returns the number of knots corresponding to the splitting.

  • Splitting(SplitValues: NCollection_Array1_int): void

    Returns the indexes of the BSpline curve knots corresponding to the splitting.
    Raised if the length of SplitValues is not equal to NbSPlit.

    Parameters (1)
    • SplitValues
      Mutated in place; read the updated value from this argument after the call.
  • SplitValue(Index: number): number

    Returns the index of the knot corresponding to the splitting of range Index.
    Raised if Index < 1 or Index > NbSplits

    Parameters (1)
    • Index

Law_Composite

Loi composite constituee d une liste de lois de ranges consecutifs. Cette implementation un peu lourde permet de reunir en une seule loi des portions de loi construites de facon independantes (par exemple en interactif) et de lancer le walking d un coup a l echelle d une ElSpine. CET OBJET REPOND DONC A UN PROBLEME D IMPLEMENTATION SPECIFIQUE AUX CONGES!!!

Constructors(2)

Static methods(2)

Instance methods(13)

  • Returns the number of intervals for continuity . May be one if Continuity(me) >= .

    Parameters (1)
    • S
  • Stores in <T> the parameters bounding the intervals of continuity . The array must provide enough room to accommodate for the parameters, i.e. T.Length() > NbIntervals().

    Parameters (2)
    • T
      Mutated in place; read the updated value from this argument after the call.
    • S
  • Value(X: number): number

    Returns the value at parameter X.

    Parameters (1)
    • X
  • D1(X: number, F: number, D: number): { F: number; D: number }

    Returns the value and the first derivative at parameter X.

    Parameters (3)
    • X
    • F
    • D
    Returns

    A result object with fields:

    • F: updated value from the call.
    • D: updated value from the call.
  • D2(X: number, F: number, D: number, D2: number): { F: number; D: number; D2: number }

    Returns the value, first and second derivatives at parameter X.

    Parameters (4)
    • X
    • F
    • D
    • D2
    Returns

    A result object with fields:

    • F: updated value from the call.
    • D: updated value from the call.
    • D2: updated value from the call.
  • Trim(PFirst: number, PLast: number, Tol: number): Law_Function

    Returns a law equivalent of <me> between parameters <First> and <Last>. <Tol> is used to test for 3d points confusion. It is usfule to determines the derivatives in these values <First> and <Last> if the Law is not Cn.

    Parameters (3)
    • PFirst
    • PLast
    • Tol
  • Bounds(PFirst: number, PLast: number): { PFirst: number; PLast: number }

    Returns the parametric bounds of the function.

    Parameters (2)
    • PFirst
    • PLast
    Returns

    A result object with fields:

    • PFirst: updated value from the call.
    • PLast: updated value from the call.
  • Returns the elementary function of the composite used to compute at parameter W.

    Parameters (1)
    • W
  • IsPeriodic(): boolean
  • SetPeriodic(): void

Law_Constant

Loi constante.

Constructors(1)

Static methods(2)

Instance methods(10)

  • Set(Radius: number, PFirst: number, PLast: number): void

    Set the radius and the range of the constant Law.

    Parameters (3)
    • Radius
    • PFirst
    • PLast
  • Returns GeomAbs_CN.

  • Returns 1.

    Parameters (1)
    • S
  • Stores in <T> the parameters bounding the intervals of continuity . The array must provide enough room to accommodate for the parameters, i.e. T.Length() > NbIntervals().

    Parameters (2)
    • T
      Mutated in place; read the updated value from this argument after the call.
    • S
  • Value(X: number): number

    Returns the value at parameter X.

    Parameters (1)
    • X
  • D1(X: number, F: number, D: number): { F: number; D: number }

    Returns the value and the first derivative at parameter X.

    Parameters (3)
    • X
    • F
    • D
    Returns

    A result object with fields:

    • F: updated value from the call.
    • D: updated value from the call.
  • D2(X: number, F: number, D: number, D2: number): { F: number; D: number; D2: number }

    Returns the value, first and second derivatives at parameter X.

    Parameters (4)
    • X
    • F
    • D
    • D2
    Returns

    A result object with fields:

    • F: updated value from the call.
    • D: updated value from the call.
    • D2: updated value from the call.
  • Trim(PFirst: number, PLast: number, Tol: number): Law_Function

    Returns a law equivalent of <me> between parameters <First> and <Last>. <Tol> is used to test for 3d points confusion. It is usfule to determines the derivatives in these values <First> and <Last> if the Law is not Cn.

    Parameters (3)
    • PFirst
    • PLast
    • Tol
  • Bounds(PFirst: number, PLast: number): { PFirst: number; PLast: number }

    Returns the parametric bounds of the function.

    Parameters (2)
    • PFirst
    • PLast
    Returns

    A result object with fields:

    • PFirst: updated value from the call.
    • PLast: updated value from the call.

Law_Function

Root class for evolution laws.

Static methods(2)

Instance methods(9)

  • Returns the number of intervals for continuity . May be one if Continuity(me) >= .

    Parameters (1)
    • S
  • Stores in <T> the parameters bounding the intervals of continuity . The array must provide enough room to accommodate for the parameters, i.e. T.Length() > NbIntervals().

    Parameters (2)
    • T
      Mutated in place; read the updated value from this argument after the call.
    • S
  • Value(X: number): number

    Returns the value of the function at the point of parameter X.

    Parameters (1)
    • X
  • D1(X: number, F: number, D: number): { F: number; D: number }

    Returns the value F and the first derivative D of the function at the point of parameter X.

    Parameters (3)
    • X
    • F
    • D
    Returns

    A result object with fields:

    • F: updated value from the call.
    • D: updated value from the call.
  • D2(X: number, F: number, D: number, D2: number): { F: number; D: number; D2: number }

    Returns the value, first and second derivatives at parameter X.

    Parameters (4)
    • X
    • F
    • D
    • D2
    Returns

    A result object with fields:

    • F: updated value from the call.
    • D: updated value from the call.
    • D2: updated value from the call.
  • Trim(PFirst: number, PLast: number, Tol: number): Law_Function

    Returns a law equivalent of <me> between parameters <First> and <Last>. <Tol> is used to test for 3d points confusion. It is usfule to determines the derivatives in these values <First> and <Last> if the Law is not Cn.

    Parameters (3)
    • PFirst
    • PLast
    • Tol
  • Bounds(PFirst: number, PLast: number): { PFirst: number; PLast: number }

    Returns the parametric bounds of the function.

    Parameters (2)
    • PFirst
    • PLast
    Returns

    A result object with fields:

    • PFirst: updated value from the call.
    • PLast: updated value from the call.

Law_Interpol

Provides an evolution law that interpolates a set of parameter and value pairs (wi, radi).

Constructors(1)

  • Constructs an empty interpolative evolution law. The function Set is used to define the law.

Static methods(2)

Instance methods(5)

  • Set(ParAndRad: NCollection_Array1_gp_Pnt2d, Periodic: boolean): void

    Defines this evolution law by interpolating the set of 2D points ParAndRad. The Y coordinate of a point of ParAndRad is the value of the function at the parameter point given by its X coordinate. If Periodic is true, this function is assumed to be periodic. Warning.

    • The X coordinates of points in the table ParAndRad must be given in ascendant order.
    • If Periodic is true, the first and last Y coordinates of points in the table ParAndRad are assumed to be equal. In addition, with the second syntax, Dd and Df are also assumed to be equal. If this is not the case, Set uses the first value(s) as last value(s).
    Parameters (2)
    • ParAndRad
    • Periodic
  • Set(ParAndRad: NCollection_Array1_gp_Pnt2d, Dd: number, Df: number, Periodic: boolean): void

    Defines this evolution law by interpolating the set of 2D points ParAndRad. The Y coordinate of a point of ParAndRad is the value of the function at the parameter point given by its X coordinate. If Periodic is true, this function is assumed to be periodic. In the second syntax, Dd and Df define the values of the first derivative of the function at its first and last points. Warning.

    • The X coordinates of points in the table ParAndRad must be given in ascendant order.
    • If Periodic is true, the first and last Y coordinates of points in the table ParAndRad are assumed to be equal. In addition, with the second syntax, Dd and Df are also assumed to be equal. If this is not the case, Set uses the first value(s) as last value(s).
    Parameters (4)
    • ParAndRad
    • Dd
    • Df
    • Periodic
  • SetInRelative(ParAndRad: NCollection_Array1_gp_Pnt2d, Ud: number, Uf: number, Periodic: boolean): void
    Parameters (4)
    • ParAndRad
    • Ud
    • Uf
    • Periodic
  • SetInRelative(ParAndRad: NCollection_Array1_gp_Pnt2d, Ud: number, Uf: number, Dd: number, Df: number, Periodic: boolean): void
    Parameters (6)
    • ParAndRad
    • Ud
    • Uf
    • Dd
    • Df
    • Periodic

Law_Interpolate

This class is used to interpolate a BsplineCurve passing through an array of points, with a C2 Continuity if tangency is not requested at the point. If tangency is requested at the point the continuity will be C1. If Perodicity is requested the curve will be closed and the junction will be the first point given. The curve will than be only C1.

Constructors(2)

  • constructor(Points: NCollection_HArray1_double, PeriodicFlag: boolean, Tolerance: number): Law_Interpolate

    Tolerance is to check if the points are not too close to one an other. It is also used to check if the tangent vector is not too small. There should be at least 2 points. If PeriodicFlag is True then the curve will be periodic be periodic.

    Parameters (3)
    • Points
    • PeriodicFlag
    • Tolerance
  • constructor(Points: NCollection_HArray1_double, Parameters: NCollection_HArray1_double, PeriodicFlag: boolean, Tolerance: number): Law_Interpolate

    Tolerance is to check if the points are not too close to one an other. It is also used to check if the tangent vector is not too small. There should be at least 2 points. If PeriodicFlag is True then the curve will be periodic be periodic.

    Parameters (4)
    • Points
    • Parameters
    • PeriodicFlag
    • Tolerance

Instance methods(6)

  • Load(InitialTangent: number, FinalTangent: number): void

    loads initial and final tangents if any.

    Parameters (2)
    • InitialTangent
    • FinalTangent
  • loads the tangents. We should have as many tangents as they are points in the array if TangentFlags.Value(i) is true use the tangent Tangents.Value(i) otherwise the tangent is not constrained.

    Parameters (2)
    • Tangents
    • TangentFlags
  • Clears the tangents if any.

  • Perform(): void

    Makes the interpolation.

  • IsDone(): boolean

Law_Linear

Describes an linear evolution law.

Constructors(1)

Static methods(2)

Instance methods(10)

  • Set(Pdeb: number, Valdeb: number, Pfin: number, Valfin: number): void

    Defines this linear evolution law by assigning both:

    • the bounds Pdeb and Pfin of the parameter, and
    • the values Valdeb and Valfin of the function at these two parametric bounds.
    Parameters (4)
    • Pdeb
    • Valdeb
    • Pfin
    • Valfin
  • Returns GeomAbs_CN.

  • Returns 1.

    Parameters (1)
    • S
  • Stores in <T> the parameters bounding the intervals of continuity . The array must provide enough room to accommodate for the parameters, i.e. T.Length() > NbIntervals().

    Parameters (2)
    • T
      Mutated in place; read the updated value from this argument after the call.
    • S
  • Value(X: number): number

    Returns the value of this function at the point of parameter X.

    Parameters (1)
    • X
  • D1(X: number, F: number, D: number): { F: number; D: number }

    Returns the value F and the first derivative D of this function at the point of parameter X.

    Parameters (3)
    • X
    • F
    • D
    Returns

    A result object with fields:

    • F: updated value from the call.
    • D: updated value from the call.
  • D2(X: number, F: number, D: number, D2: number): { F: number; D: number; D2: number }

    Returns the value, first and second derivatives at parameter X.

    Parameters (4)
    • X
    • F
    • D
    • D2
    Returns

    A result object with fields:

    • F: updated value from the call.
    • D: updated value from the call.
    • D2: updated value from the call.
  • Trim(PFirst: number, PLast: number, Tol: number): Law_Function

    Returns a law equivalent of <me> between parameters <First> and <Last>. <Tol> is used to test for 3d points confusion. It is usfule to determines the derivatives in these values <First> and <Last> if the Law is not Cn.

    Parameters (3)
    • PFirst
    • PLast
    • Tol
  • Bounds(PFirst: number, PLast: number): { PFirst: number; PLast: number }

    Returns the parametric bounds of the function.

    Parameters (2)
    • PFirst
    • PLast
    Returns

    A result object with fields:

    • PFirst: updated value from the call.
    • PLast: updated value from the call.

Law_S

Describes an "S" evolution law.

Constructors(1)

Static methods(2)

Instance methods(3)

  • Set(Pdeb: number, Valdeb: number, Pfin: number, Valfin: number): void

    Defines this S evolution law by assigning both:

    • the bounds Pdeb and Pfin of the parameter, and
    • the values Valdeb and Valfin of the function at these two parametric bounds. The function is assumed to have the first derivatives equal to 0 at the two parameter points Pdeb and Pfin.
    Parameters (4)
    • Pdeb
    • Valdeb
    • Pfin
    • Valfin
  • Set(Pdeb: number, Valdeb: number, Ddeb: number, Pfin: number, Valfin: number, Dfin: number): void

    Defines this S evolution law by assigning.

    • the bounds Pdeb and Pfin of the parameter,
    • the values Valdeb and Valfin of the function at these two parametric bounds, and
    • the values Ddeb and Dfin of the first derivative of the function at these two parametric bounds.
    Parameters (6)
    • Pdeb
    • Valdeb
    • Ddeb
    • Pfin
    • Valfin
    • Dfin