OpenCascade.js
API ReferenceFoundationClassesTKMath

BSplSLib

OCCT package BSplSLib: BSplSLib, BSplSLib_Cache, BSplSLib_EvaluatorFunction.

BSplSLib

BSplSLib B-spline surface Library This package provides an implementation of geometric functions for rational and non rational, periodic and non periodic B-spline surface computation.
this package uses the multi-dimensions splines methods provided in the package BSplCLib.
In this package the B-spline surface is defined with: . its control points : Array2OfPnt Poles . its weights : Array2OfReal Weights . its knots and their multiplicity in the two parametric direction U and V: Array1OfReal UKnots, VKnots and Array1OfInteger UMults, VMults. . the degree of the normalized Spline functions: UDegree, VDegree
. the Booleans URational, VRational to know if the weights are constant in the U or V direction.
. the Booleans UPeriodic, VRational to know if the surface is periodic in the U or V direction.
Warnings: The bounds of UKnots and UMults should be the same, the bounds of VKnots and VMults should be the same, the bounds of Poles and Weights should be the same.
The Control points representation is: Poles(Uorigin,Vorigin) ...................Poles(Uorigin,Vend) . . . . Poles(Uend, Vorigin) .....................Poles(Uend, Vend)
For the double array the row indice corresponds to the parametric U direction and the columns indice corresponds to the parametric V direction.
Note: weight and multiplicity arrays can be passed by pointer for some functions so that NULL pointer is valid. That means no weights/no multiplicities passed.
KeyWords : B-spline surface, Functions, Library
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(1)

Static methods(37)

  • RationalDerivative(UDeg: number, VDeg: number, N: number, M: number, Ders: number, RDers: number, All: boolean): { Ders: number; RDers: number }

    this is a one dimensional function typedef void (*EvaluatorFunction) ( int // Derivative Request double * // StartEnd[2][2] // [0] = U // [1] = V // [0] = start // [1] = end double // UParameter double // VParamerer double & // Result int &) ;// Error Code serves to multiply a given vectorial BSpline by a function Computes the derivatives of a ratio of two-variables functions x(u,v) / w(u,v) at orders <N,M>, x(u,v) is a vector in dimension <3>.
    <Ders> is an array containing the values of the input derivatives from 0 to std::min(<N>,<UDeg>), 0 to std::min(<M>,<VDeg>). For orders higher than <UDeg,VDeg> the input derivatives are assumed to be 0.
    The <Ders> is a 2d array and the dimension of the lines is always (<VDeg>+1) * (<3>+1), even if <N> is smaller than <Udeg> (the derivatives higher than <N> are not used).
    Content of <Ders>:
    x(i,j)[k] means: the composant k of x derivated (i) times in u and (j) times in v.
    ... First line ...
    x[1],x[2],...,x[3],w x(0,1)[1],...,x(0,1)[3],w(1,0) ... x(0,VDeg)[1],...,x(0,VDeg)[3],w(0,VDeg)
    ... Then second line ...
    x(1,0)[1],...,x(1,0)[3],w(1,0) x(1,1)[1],...,x(1,1)[3],w(1,1) ... x(1,VDeg)[1],...,x(1,VDeg)[3],w(1,VDeg)
    ...
    ... Last line ...
    x(UDeg,0)[1],...,x(UDeg,0)[3],w(UDeg,0) x(UDeg,1)[1],...,x(UDeg,1)[3],w(UDeg,1) ... x(Udeg,VDeg)[1],...,x(UDeg,VDeg)[3],w(Udeg,VDeg)
    If <All> is false, only the derivative at order <N,M> is computed. <RDers> is an array of length 3 which will contain the result :
    x(1)/w , x(2)/w , ... derivated <N> <M> times
    If <All> is true multiples derivatives are computed. All the derivatives (i,j) with 0 <= i+j <= std::max(N,M) are computed. <RDers> is an array of length 3 * (<N>+1) * (<M>+1) which will contains:
    x(1)/w , x(2)/w , ... x(1)/w , x(2)/w , ... derivated <0,1> times x(1)/w , x(2)/w , ... derivated <0,2> times ... x(1)/w , x(2)/w , ... derivated <0,N> times
    x(1)/w , x(2)/w , ... derivated <1,0> times x(1)/w , x(2)/w , ... derivated <1,1> times ... x(1)/w , x(2)/w , ... derivated <1,N> times
    x(1)/w , x(2)/w , ... derivated <N,0> times .... Warning: <RDers> must be dimensioned properly.

    Parameters (7)
    • UDeg
    • VDeg
    • N
    • M
    • Ders
    • RDers
    • All
    Returns

    A result object with fields:

    • Ders: updated value from the call.
    • RDers: updated value from the call.
  • D0(U: number, V: number, UIndex: number, VIndex: number, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, UKnots: NCollection_Array1_double, VKnots: NCollection_Array1_double, UMults: NCollection_Array1_int, VMults: NCollection_Array1_int, UDegree: number, VDegree: number, URat: boolean, VRat: boolean, UPer: boolean, VPer: boolean, P: gp_Pnt): void
    Parameters (17)
    • U
    • V
    • UIndex
    • VIndex
    • Poles
    • Weights
    • UKnots
    • VKnots
    • UMults
    • VMults
    • UDegree
    • VDegree
    • URat
    • VRat
    • UPer
    • VPer
    • P
  • D1(U: number, V: number, UIndex: number, VIndex: number, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, UKnots: NCollection_Array1_double, VKnots: NCollection_Array1_double, UMults: NCollection_Array1_int, VMults: NCollection_Array1_int, Degree: number, VDegree: number, URat: boolean, VRat: boolean, UPer: boolean, VPer: boolean, P: gp_Pnt, Vu: gp_Vec, Vv: gp_Vec): void
    Parameters (19)
    • U
    • V
    • UIndex
    • VIndex
    • Poles
    • Weights
    • UKnots
    • VKnots
    • UMults
    • VMults
    • Degree
    • VDegree
    • URat
    • VRat
    • UPer
    • VPer
    • P
    • Vu
    • Vv
  • D2(U: number, V: number, UIndex: number, VIndex: number, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, UKnots: NCollection_Array1_double, VKnots: NCollection_Array1_double, UMults: NCollection_Array1_int, VMults: NCollection_Array1_int, UDegree: number, VDegree: number, URat: boolean, VRat: boolean, UPer: boolean, VPer: boolean, P: gp_Pnt, Vu: gp_Vec, Vv: gp_Vec, Vuu: gp_Vec, Vvv: gp_Vec, Vuv: gp_Vec): void
    Parameters (22)
    • U
    • V
    • UIndex
    • VIndex
    • Poles
    • Weights
    • UKnots
    • VKnots
    • UMults
    • VMults
    • UDegree
    • VDegree
    • URat
    • VRat
    • UPer
    • VPer
    • P
    • Vu
    • Vv
    • Vuu
    • Vvv
    • Vuv
  • D3(U: number, V: number, UIndex: number, VIndex: number, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, UKnots: NCollection_Array1_double, VKnots: NCollection_Array1_double, UMults: NCollection_Array1_int, VMults: NCollection_Array1_int, UDegree: number, VDegree: number, URat: boolean, VRat: boolean, UPer: boolean, VPer: boolean, P: gp_Pnt, Vu: gp_Vec, Vv: gp_Vec, Vuu: gp_Vec, Vvv: gp_Vec, Vuv: gp_Vec, Vuuu: gp_Vec, Vvvv: gp_Vec, Vuuv: gp_Vec, Vuvv: gp_Vec): void
    Parameters (26)
    • U
    • V
    • UIndex
    • VIndex
    • Poles
    • Weights
    • UKnots
    • VKnots
    • UMults
    • VMults
    • UDegree
    • VDegree
    • URat
    • VRat
    • UPer
    • VPer
    • P
    • Vu
    • Vv
    • Vuu
    • Vvv
    • Vuv
    • Vuuu
    • Vvvv
    • Vuuv
    • Vuvv
  • DN(U: number, V: number, Nu: number, Nv: number, UIndex: number, VIndex: number, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, UKnots: NCollection_Array1_double, VKnots: NCollection_Array1_double, UMults: NCollection_Array1_int, VMults: NCollection_Array1_int, UDegree: number, VDegree: number, URat: boolean, VRat: boolean, UPer: boolean, VPer: boolean, Vn: gp_Vec): void
    Parameters (19)
    • U
    • V
    • Nu
    • Nv
    • UIndex
    • VIndex
    • Poles
    • Weights
    • UKnots
    • VKnots
    • UMults
    • VMults
    • UDegree
    • VDegree
    • URat
    • VRat
    • UPer
    • VPer
    • Vn
  • Iso(Param: number, IsU: boolean, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, Knots: NCollection_Array1_double, Mults: NCollection_Array1_int, Degree: number, Periodic: boolean, CPoles: NCollection_Array1_gp_Pnt, CWeights: NCollection_Array1_double): void

    Computes the poles and weights of an isoparametric curve at parameter (UIso if <IsU> is True, VIso else).

    Parameters (10)
    • Param
    • IsU
    • Poles
    • Weights
    • Knots
    • Mults
    • Degree
    • Periodic
    • CPoles
      Mutated in place; read the updated value from this argument after the call.
    • CWeights
  • Reverse(Poles: NCollection_Array2_gp_Pnt, Last: number, UDirection: boolean): void

    Reverses the array of poles. Last is the Index of the new first Row( Col) of Poles. On a non periodic surface Last is Poles.Upper(). On a periodic curve last is (number of flat knots - degree - 1) or (sum of multiplicities(but for the last) + degree.

    • 1)
    Parameters (3)
    • Poles
      Mutated in place; read the updated value from this argument after the call.
    • Last
    • UDirection
  • Reverse(Weights: NCollection_Array2_double, Last: number, UDirection: boolean): void

    Reverses the array of weights.

    Parameters (3)
    • Weights
      Mutated in place; read the updated value from this argument after the call.
    • Last
    • UDirection
  • HomogeneousD0(U: number, V: number, UIndex: number, VIndex: number, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, UKnots: NCollection_Array1_double, VKnots: NCollection_Array1_double, UMults: NCollection_Array1_int, VMults: NCollection_Array1_int, UDegree: number, VDegree: number, URat: boolean, VRat: boolean, UPer: boolean, VPer: boolean, W: number, P: gp_Pnt): { W: number }

    Makes an homogeneous evaluation of Poles and Weights any and returns in P the Numerator value and in W the Denominator value if Weights are present otherwise returns 1.0e0.

    Parameters (18)
    • U
    • V
    • UIndex
    • VIndex
    • Poles
    • Weights
    • UKnots
    • VKnots
    • UMults
    • VMults
    • UDegree
    • VDegree
    • URat
    • VRat
    • UPer
    • VPer
    • W
    • P
      Mutated in place; read the updated value from this argument after the call.
    Returns

    A result object with fields:

    • W: updated value from the call.
  • HomogeneousD1(U: number, V: number, UIndex: number, VIndex: number, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, UKnots: NCollection_Array1_double, VKnots: NCollection_Array1_double, UMults: NCollection_Array1_int, VMults: NCollection_Array1_int, UDegree: number, VDegree: number, URat: boolean, VRat: boolean, UPer: boolean, VPer: boolean, N: gp_Pnt, Nu: gp_Vec, Nv: gp_Vec, D: number, Du: number, Dv: number): { D: number; Du: number; Dv: number }

    Makes an homogeneous evaluation of Poles and Weights any and returns in P the Numerator value and in W the Denominator value if Weights are present otherwise returns 1.0e0.

    Parameters (22)
    • U
    • V
    • UIndex
    • VIndex
    • Poles
    • Weights
    • UKnots
    • VKnots
    • UMults
    • VMults
    • UDegree
    • VDegree
    • URat
    • VRat
    • UPer
    • VPer
    • N
      Mutated in place; read the updated value from this argument after the call.
    • Nu
      Mutated in place; read the updated value from this argument after the call.
    • Nv
      Mutated in place; read the updated value from this argument after the call.
    • D
    • Du
    • Dv
    Returns

    A result object with fields:

    • D: updated value from the call.
    • Du: updated value from the call.
    • Dv: updated value from the call.
  • IsRational(Weights: NCollection_Array2_double, I1: number, I2: number, J1: number, J2: number, Epsilon?: number): boolean

    Returns False if all the weights of the array <Weights> in the area [I1,I2] * [J1,J2] are identic. Epsilon is used for comparing weights. If Epsilon is 0. the Epsilon of the first weight is used.

    Parameters (6)
    • Weights
    • I1
    • I2
    • J1
    • J2
    • Epsilon
  • SetPoles(Poles: NCollection_Array2_gp_Pnt, FP: NCollection_Array1_double, UDirection: boolean): void

    Copy in FP the coordinates of the poles.

    Parameters (3)
    • Poles
    • FP
      Mutated in place; read the updated value from this argument after the call.
    • UDirection
  • Copy in FP the coordinates of the poles.

    Parameters (4)
    • Poles
    • Weights
    • FP
      Mutated in place; read the updated value from this argument after the call.
    • UDirection
  • GetPoles(FP: NCollection_Array1_double, Poles: NCollection_Array2_gp_Pnt, UDirection: boolean): void

    Get from FP the coordinates of the poles.

    Parameters (3)
    • FP
    • Poles
      Mutated in place; read the updated value from this argument after the call.
    • UDirection
  • Get from FP the coordinates of the poles.

    Parameters (4)
    • FP
    • Poles
      Mutated in place; read the updated value from this argument after the call.
    • Weights
      Mutated in place; read the updated value from this argument after the call.
    • UDirection
  • MovePoint(U: number, V: number, Displ: gp_Vec, UIndex1: number, UIndex2: number, VIndex1: number, VIndex2: number, UDegree: number, VDegree: number, Rational: boolean, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, UFlatKnots: NCollection_Array1_double, VFlatKnots: NCollection_Array1_double, UFirstIndex: number, ULastIndex: number, VFirstIndex: number, VLastIndex: number, NewPoles: NCollection_Array2_gp_Pnt): { UFirstIndex: number; ULastIndex: number; VFirstIndex: number; VLastIndex: number }

    Find the new poles which allows an old point (with a given u,v as parameters) to reach a new position UIndex1,UIndex2 indicate the range of poles we can move for U (1, UNbPoles-1) or (2, UNbPoles) -> no constraint for one side in U (2, UNbPoles-1) -> the ends are enforced for U don't enter (1,NbPoles) and (1,VNbPoles) -> error: rigid move if problem in BSplineBasis calculation, no change for the curve and UFirstIndex, VLastIndex = 0 VFirstIndex, VLastIndex = 0.

    Parameters (19)
    • U
    • V
    • Displ
    • UIndex1
    • UIndex2
    • VIndex1
    • VIndex2
    • UDegree
    • VDegree
    • Rational
    • Poles
    • Weights
    • UFlatKnots
    • VFlatKnots
    • UFirstIndex
    • ULastIndex
    • VFirstIndex
    • VLastIndex
    • NewPoles
      Mutated in place; read the updated value from this argument after the call.
    Returns

    A result object with fields:

    • UFirstIndex: updated value from the call.
    • ULastIndex: updated value from the call.
    • VFirstIndex: updated value from the call.
    • VLastIndex: updated value from the call.
  • InsertKnots(UDirection: boolean, Degree: number, Periodic: boolean, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, Knots: NCollection_Array1_double, Mults: NCollection_Array1_int, AddKnots: NCollection_Array1_double, AddMults: NCollection_Array1_int, NewPoles: NCollection_Array2_gp_Pnt, NewWeights: NCollection_Array2_double, NewKnots: NCollection_Array1_double, NewMults: NCollection_Array1_int, Epsilon: number, Add: boolean): void
    Parameters (15)
    • UDirection
    • Degree
    • Periodic
    • Poles
    • Weights
    • Knots
    • Mults
    • AddKnots
    • AddMults
    • NewPoles
    • NewWeights
    • NewKnots
    • NewMults
    • Epsilon
    • Add
  • RemoveKnot(UDirection: boolean, Index: number, Mult: number, Degree: number, Periodic: boolean, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, Knots: NCollection_Array1_double, Mults: NCollection_Array1_int, NewPoles: NCollection_Array2_gp_Pnt, NewWeights: NCollection_Array2_double, NewKnots: NCollection_Array1_double, NewMults: NCollection_Array1_int, Tolerance: number): boolean
    Parameters (14)
    • UDirection
    • Index
    • Mult
    • Degree
    • Periodic
    • Poles
    • Weights
    • Knots
    • Mults
    • NewPoles
    • NewWeights
    • NewKnots
    • NewMults
    • Tolerance
  • IncreaseDegree(UDirection: boolean, Degree: number, NewDegree: number, Periodic: boolean, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, Knots: NCollection_Array1_double, Mults: NCollection_Array1_int, NewPoles: NCollection_Array2_gp_Pnt, NewWeights: NCollection_Array2_double, NewKnots: NCollection_Array1_double, NewMults: NCollection_Array1_int): void
    Parameters (12)
    • UDirection
    • Degree
    • NewDegree
    • Periodic
    • Poles
    • Weights
    • Knots
    • Mults
    • NewPoles
    • NewWeights
    • NewKnots
    • NewMults
  • Parameters (10)
    • UDirection
    • Degree
    • Mults
    • Knots
    • Poles
    • Weights
    • NewMults
    • NewKnots
    • NewPoles
    • NewWeights
  • Used as argument for a non rational curve.

  • BuildCache(U: number, V: number, USpanDomain: number, VSpanDomain: number, UPeriodicFlag: boolean, VPeriodicFlag: boolean, UDegree: number, VDegree: number, UIndex: number, VIndex: number, UFlatKnots: NCollection_Array1_double, VFlatKnots: NCollection_Array1_double, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, CachePoles: NCollection_Array2_gp_Pnt, CacheWeights: NCollection_Array2_double): void

    Perform the evaluation of the Taylor expansion of the Bspline normalized between 0 and 1. If rational computes the homogeneous Taylor expansion for the numerator and stores it in CachePoles.

    Parameters (16)
    • U
    • V
    • USpanDomain
    • VSpanDomain
    • UPeriodicFlag
    • VPeriodicFlag
    • UDegree
    • VDegree
    • UIndex
    • VIndex
    • UFlatKnots
    • VFlatKnots
    • Poles
    • Weights
    • CachePoles
      Mutated in place; read the updated value from this argument after the call.
    • CacheWeights
  • BuildCache(theU: number, theV: number, theUSpanDomain: number, theVSpanDomain: number, theUPeriodic: boolean, theVPeriodic: boolean, theUDegree: number, theVDegree: number, theUIndex: number, theVIndex: number, theUFlatKnots: NCollection_Array1_double, theVFlatKnots: NCollection_Array1_double, thePoles: NCollection_Array2_gp_Pnt, theWeights: NCollection_Array2_double, theCacheArray: NCollection_Array2_double): void

    Perform the evaluation of the Taylor expansion of the Bspline normalized between 0 and 1. Structure of result optimized for BSplSLib_Cache.

    Parameters (15)
    • theU
    • theV
    • theUSpanDomain
    • theVSpanDomain
    • theUPeriodic
    • theVPeriodic
    • theUDegree
    • theVDegree
    • theUIndex
    • theVIndex
    • theUFlatKnots
    • theVFlatKnots
    • thePoles
    • theWeights
    • theCacheArray
      Mutated in place; read the updated value from this argument after the call.
  • CacheD0(U: number, V: number, UDegree: number, VDegree: number, UCacheParameter: number, VCacheParameter: number, USpanLenght: number, VSpanLength: number, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, Point: gp_Pnt): void

    Perform the evaluation of the of the cache the parameter must be normalized between the 0 and 1 for the span. The Cache must be valid when calling this routine. Geom Package will insure that. and then multiplies by the weights this just evaluates the current point the CacheParameter is where the Cache was constructed the SpanLength is to normalize the polynomial in the cache to avoid bad conditioning effects.

    Parameters (11)
    • U
    • V
    • UDegree
    • VDegree
    • UCacheParameter
    • VCacheParameter
    • USpanLenght
    • VSpanLength
    • Poles
    • Weights
    • Point
      Mutated in place; read the updated value from this argument after the call.
  • CoefsD0(U: number, V: number, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, Point: gp_Pnt): void

    Calls CacheD0 for Bezier Surfaces Arrays computed with the method PolesCoefficients. Warning: To be used for BezierSurfaces ONLY!!!

    Parameters (5)
    • U
    • V
    • Poles
    • Weights
    • Point
      Mutated in place; read the updated value from this argument after the call.
  • CacheD1(U: number, V: number, UDegree: number, VDegree: number, UCacheParameter: number, VCacheParameter: number, USpanLenght: number, VSpanLength: number, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, Point: gp_Pnt, VecU: gp_Vec, VecV: gp_Vec): void

    Perform the evaluation of the of the cache the parameter must be normalized between the 0 and 1 for the span. The Cache must be valid when calling this routine. Geom Package will insure that. and then multiplies by the weights this just evaluates the current point the CacheParameter is where the Cache was constructed the SpanLength is to normalize the polynomial in the cache to avoid bad conditioning effects.

    Parameters (13)
    • U
    • V
    • UDegree
    • VDegree
    • UCacheParameter
    • VCacheParameter
    • USpanLenght
    • VSpanLength
    • Poles
    • Weights
    • Point
      Mutated in place; read the updated value from this argument after the call.
    • VecU
      Mutated in place; read the updated value from this argument after the call.
    • VecV
      Mutated in place; read the updated value from this argument after the call.
  • CoefsD1(U: number, V: number, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, Point: gp_Pnt, VecU: gp_Vec, VecV: gp_Vec): void

    Calls CacheD0 for Bezier Surfaces Arrays computed with the method PolesCoefficients. Warning: To be used for BezierSurfaces ONLY!!!

    Parameters (7)
    • U
    • V
    • Poles
    • Weights
    • Point
      Mutated in place; read the updated value from this argument after the call.
    • VecU
      Mutated in place; read the updated value from this argument after the call.
    • VecV
      Mutated in place; read the updated value from this argument after the call.
  • CacheD2(U: number, V: number, UDegree: number, VDegree: number, UCacheParameter: number, VCacheParameter: number, USpanLenght: number, VSpanLength: number, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, Point: gp_Pnt, VecU: gp_Vec, VecV: gp_Vec, VecUU: gp_Vec, VecUV: gp_Vec, VecVV: gp_Vec): void

    Perform the evaluation of the of the cache the parameter must be normalized between the 0 and 1 for the span. The Cache must be valid when calling this routine. Geom Package will insure that. and then multiplies by the weights this just evaluates the current point the CacheParameter is where the Cache was constructed the SpanLength is to normalize the polynomial in the cache to avoid bad conditioning effects.

    Parameters (16)
    • U
    • V
    • UDegree
    • VDegree
    • UCacheParameter
    • VCacheParameter
    • USpanLenght
    • VSpanLength
    • Poles
    • Weights
    • Point
      Mutated in place; read the updated value from this argument after the call.
    • VecU
      Mutated in place; read the updated value from this argument after the call.
    • VecV
      Mutated in place; read the updated value from this argument after the call.
    • VecUU
      Mutated in place; read the updated value from this argument after the call.
    • VecUV
      Mutated in place; read the updated value from this argument after the call.
    • VecVV
      Mutated in place; read the updated value from this argument after the call.
  • CoefsD2(U: number, V: number, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, Point: gp_Pnt, VecU: gp_Vec, VecV: gp_Vec, VecUU: gp_Vec, VecUV: gp_Vec, VecVV: gp_Vec): void

    Calls CacheD0 for Bezier Surfaces Arrays computed with the method PolesCoefficients. Warning: To be used for BezierSurfaces ONLY!!!

    Parameters (10)
    • U
    • V
    • Poles
    • Weights
    • Point
      Mutated in place; read the updated value from this argument after the call.
    • VecU
      Mutated in place; read the updated value from this argument after the call.
    • VecV
      Mutated in place; read the updated value from this argument after the call.
    • VecUU
      Mutated in place; read the updated value from this argument after the call.
    • VecUV
      Mutated in place; read the updated value from this argument after the call.
    • VecVV
      Mutated in place; read the updated value from this argument after the call.
  • Warning! To be used for BezierSurfaces ONLY!!!

    Parameters (2)
    • Poles
    • CachePoles
      Mutated in place; read the updated value from this argument after the call.
  • Encapsulation of BuildCache to perform the evaluation of the Taylor expansion for beziersurfaces at parameters 0.,0.; Warning: To be used for BezierSurfaces ONLY!!!

    Parameters (4)
    • Poles
    • Weights
    • CachePoles
      Mutated in place; read the updated value from this argument after the call.
    • CacheWeights
  • Resolution(Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, UKnots: NCollection_Array1_double, VKnots: NCollection_Array1_double, UMults: NCollection_Array1_int, VMults: NCollection_Array1_int, UDegree: number, VDegree: number, URat: boolean, VRat: boolean, UPer: boolean, VPer: boolean, Tolerance3D: number, UTolerance: number, VTolerance: number): { UTolerance: number; VTolerance: number }

    Given a tolerance in 3D space returns two tolerances, one in U one in V such that for all (u1,v1) and (u0,v0) in the domain of the surface f(u,v) we have : | u1 - u0 | < UTolerance and | v1 - v0 | < VTolerance we have |f (u1,v1) - f (u0,v0)| < Tolerance3D.

    Parameters (15)
    • Poles
    • Weights
    • UKnots
    • VKnots
    • UMults
    • VMults
    • UDegree
    • VDegree
    • URat
    • VRat
    • UPer
    • VPer
    • Tolerance3D
    • UTolerance
    • VTolerance
    Returns

    A result object with fields:

    • UTolerance: updated value from the call.
    • VTolerance: updated value from the call.
  • Interpolate(UDegree: number, VDegree: number, UFlatKnots: NCollection_Array1_double, VFlatKnots: NCollection_Array1_double, UParameters: NCollection_Array1_double, VParameters: NCollection_Array1_double, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, InversionProblem: number): { InversionProblem: number }

    Performs the interpolation of the data points given in the Poles array in the form [1,...,RL][1,...,RC][1...PolesDimension]. The ColLength CL and the Length of UParameters must be the same. The length of VFlatKnots is VDegree + CL + 1.
    The RowLength RL and the Length of VParameters must be the same. The length of VFlatKnots is Degree + RL + 1.
    Warning: the method used to do that interpolation is gauss elimination WITHOUT pivoting. Thus if the diagonal is not dominant there is no guarantee that the algorithm will work. Nevertheless for Cubic interpolation at knots or interpolation at Scheonberg points the method will work. The InversionProblem will report 0 if there was no problem else it will give the index of the faulty pivot

    Parameters (9)
    • UDegree
    • VDegree
    • UFlatKnots
    • VFlatKnots
    • UParameters
    • VParameters
    • Poles
      Mutated in place; read the updated value from this argument after the call.
    • Weights
      Mutated in place; read the updated value from this argument after the call.
    • InversionProblem
    Returns

    A result object with fields:

    • InversionProblem: updated value from the call.
  • Interpolate(UDegree: number, VDegree: number, UFlatKnots: NCollection_Array1_double, VFlatKnots: NCollection_Array1_double, UParameters: NCollection_Array1_double, VParameters: NCollection_Array1_double, Poles: NCollection_Array2_gp_Pnt, InversionProblem: number): { InversionProblem: number }

    Performs the interpolation of the data points given in the Poles array. The ColLength CL and the Length of UParameters must be the same. The length of VFlatKnots is VDegree + CL + 1.
    The RowLength RL and the Length of VParameters must be the same. The length of VFlatKnots is Degree + RL + 1.
    Warning: the method used to do that interpolation is gauss elimination WITHOUT pivoting. Thus if the diagonal is not dominant there is no guarantee that the algorithm will work. Nevertheless for Cubic interpolation at knots or interpolation at Scheonberg points the method will work. The InversionProblem will report 0 if there was no problem else it will give the index of the faulty pivot

    Parameters (8)
    • UDegree
    • VDegree
    • UFlatKnots
    • VFlatKnots
    • UParameters
    • VParameters
    • Poles
      Mutated in place; read the updated value from this argument after the call.
    • InversionProblem
    Returns

    A result object with fields:

    • InversionProblem: updated value from the call.
  • FunctionMultiply(Function: BSplSLib_EvaluatorFunction, UBSplineDegree: number, VBSplineDegree: number, UBSplineKnots: NCollection_Array1_double, VBSplineKnots: NCollection_Array1_double, UMults: NCollection_Array1_int, VMults: NCollection_Array1_int, Poles: NCollection_Array2_gp_Pnt, Weights: NCollection_Array2_double, UFlatKnots: NCollection_Array1_double, VFlatKnots: NCollection_Array1_double, UNewDegree: number, VNewDegree: number, NewNumerator: NCollection_Array2_gp_Pnt, NewDenominator: NCollection_Array2_double, theStatus: number): { theStatus: number }

    this will multiply a given BSpline numerator N(u,v) and denominator D(u,v) defined by its U/VBSplineDegree and U/VBSplineKnots, and U/VMults. Its Poles and Weights are arrays which are coded as array2 of the form [1..UNumPoles][1..VNumPoles] by a function a(u,v) which is assumed to satisfy the following:

    1. a(u,v) * N(u,v) and a(u,v) * D(u,v) is a polynomial BSpline that can be expressed exactly as a BSpline of degree U/VNewDegree on the knots U/VFlatKnots
    2. the range of a(u,v) is the same as the range of N(u,v) or D(u,v) Warning: it is the caller's responsibility to insure that conditions 1. and 2. above are satisfied no check whatsoever is made in this method theStatus will return 0 if OK else it will return the pivot index of the matrix that was inverted to compute the multiplied BSpline : the method used is interpolation at Schoenenberg points of a(u,v)* N(u,v) and a(u,v) * D(u,v) theStatus will return 0 if OK else it will return the pivot index of the matrix that was inverted to compute the multiplied BSpline: the method used is interpolation at Schoenenberg
      *points of a(u,v)F(u,v)
    Parameters (16)
    • Function
    • UBSplineDegree
    • VBSplineDegree
    • UBSplineKnots
    • VBSplineKnots
    • UMults
    • VMults
    • Poles
    • Weights
    • UFlatKnots
    • VFlatKnots
    • UNewDegree
    • VNewDegree
    • NewNumerator
      Mutated in place; read the updated value from this argument after the call.
    • NewDenominator
      Mutated in place; read the updated value from this argument after the call.
    • theStatus
    Returns

    A result object with fields:

    • theStatus: updated value from the call.
  • UnitWeights(theNbUPoles: number, theNbVPoles: number): NCollection_Array2_double

    Returns an NCollection_Array2<double> filled with 1.0 values. If theNbUPoles * theNbVPoles <= BSplCLib::MaxUnitWeightsSize(), references a pre-allocated global array (zero allocation). Otherwise, allocates a new array and fills with 1.0.

    Parameters (2)
    • theNbUPoles
      number of poles in U direction
    • theNbVPoles
      number of poles in V direction
    Returns

    array of unit weights with bounds [1, theNbUPoles] x [1, theNbVPoles]

    Remarks

    Warning: The returned array may reference global static memory - do NOT modify elements.

BSplSLib_Cache

A cache class for Bezier and B-spline surfaces.
Defines all data, that can be cached on a span of the surface. The data should be recalculated in going from span to span.

Constructors(1)

  • constructor(theDegreeU: number, thePeriodicU: boolean, theFlatKnotsU: NCollection_Array1_double, theDegreeV: number, thePeriodicV: boolean, theFlatKnotsV: NCollection_Array1_double, theWeights?: NCollection_Array2_double): BSplSLib_Cache

    Constructor for caching of the span for the surface.

    Parameters (7)
    • theDegreeU
      degree along the first parameter (U) of the surface
    • thePeriodicU
      identify the surface is periodical along U axis
    • theFlatKnotsU
      knots of the surface (with repetition) along U axis
    • theDegreeV
      degree along the second parameter (V) of the surface
    • thePeriodicV
      identify the surface is periodical along V axis
    • theFlatKnotsV
      knots of the surface (with repetition) along V axis
    • theWeights
      array of weights of corresponding poles

Static methods(2)

Instance methods(9)

  • IsCacheValid(theParameterU: number, theParameterV: number): boolean

    Verifies validity of the cache using parameters of the point.

    Parameters (2)
    • theParameterU
      first parameter of the point placed in the span
    • theParameterV
      second parameter of the point placed in the span
  • BuildCache(theParameterU: number, theParameterV: number, theFlatKnotsU: NCollection_Array1_double, theFlatKnotsV: NCollection_Array1_double, thePoles: NCollection_Array2_gp_Pnt, theWeights?: NCollection_Array2_double): void

    Recomputes the cache data. Does not verify validity of the cache.

    Parameters (6)
    • theParameterU
      the parametric value on the U axis to identify the span
    • theParameterV
      the parametric value on the V axis to identify the span
    • theFlatKnotsU
      flat knots of the surface along U axis
    • theFlatKnotsV
      flat knots of the surface along V axis
    • thePoles
      array of poles of the surface
    • theWeights
      array of weights of corresponding poles
  • D0(theU: number, theV: number, thePoint: gp_Pnt): void

    Calculates the point on the surface for specified parameters.

    Parameters (3)
    • theU
      first parameter for calculation of the value
    • theV
      second parameter for calculation of the value
    • thePoint
      the result of calculation (the point on the surface) Mutated in place; read the updated value from this argument after the call.
  • D1(theU: number, theV: number, thePoint: gp_Pnt, theTangentU: gp_Vec, theTangentV: gp_Vec): void

    Calculates the point on the surface and its first derivative.

    Parameters (5)
    • theU
      first parameter of calculation of the value
    • theV
      second parameter of calculation of the value
    • thePoint
      the result of calculation (the point on the surface) Mutated in place; read the updated value from this argument after the call.
    • theTangentU
      tangent vector along U axis in the calculated point Mutated in place; read the updated value from this argument after the call.
    • theTangentV
      tangent vector along V axis in the calculated point Mutated in place; read the updated value from this argument after the call.
  • D2(theU: number, theV: number, thePoint: gp_Pnt, theTangentU: gp_Vec, theTangentV: gp_Vec, theCurvatureU: gp_Vec, theCurvatureV: gp_Vec, theCurvatureUV: gp_Vec): void

    Calculates the point on the surface and derivatives till second order.

    Parameters (8)
    • theU
      first parameter of calculation of the value
    • theV
      second parameter of calculation of the value
    • thePoint
      the result of calculation (the point on the surface) Mutated in place; read the updated value from this argument after the call.
    • theTangentU
      tangent vector along U axis in the calculated point Mutated in place; read the updated value from this argument after the call.
    • theTangentV
      tangent vector along V axis in the calculated point Mutated in place; read the updated value from this argument after the call.
    • theCurvatureU
      curvature vector (2nd derivative on U) along U axis Mutated in place; read the updated value from this argument after the call.
    • theCurvatureV
      curvature vector (2nd derivative on V) along V axis Mutated in place; read the updated value from this argument after the call.
    • theCurvatureUV
      2nd mixed derivative on U anv V Mutated in place; read the updated value from this argument after the call.
  • D0Local(theLocalU: number, theLocalV: number, thePoint: gp_Pnt): void

    Calculates the point using pre-computed local parameters in [-1, 1] range. This bypasses periodic normalization and local parameter calculation.

    Parameters (3)
    • theLocalU
      pre-computed local U parameter: (U - SpanMid) / SpanHalfLen
    • theLocalV
      pre-computed local V parameter: (V - SpanMid) / SpanHalfLen
    • thePoint
      the result of calculation (the point on the surface) Mutated in place; read the updated value from this argument after the call.
  • D1Local(theLocalU: number, theLocalV: number, thePoint: gp_Pnt, theTangentU: gp_Vec, theTangentV: gp_Vec): void

    Calculates the point and first derivatives using pre-computed local parameters in [-1, 1] range. This bypasses periodic normalization and local parameter calculation.

    Parameters (5)
    • theLocalU
      pre-computed local U parameter: (U - SpanMid) / SpanHalfLen
    • theLocalV
      pre-computed local V parameter: (V - SpanMid) / SpanHalfLen
    • thePoint
      the result of calculation (the point on the surface) Mutated in place; read the updated value from this argument after the call.
    • theTangentU
      tangent vector along U axis in the calculated point Mutated in place; read the updated value from this argument after the call.
    • theTangentV
      tangent vector along V axis in the calculated point Mutated in place; read the updated value from this argument after the call.
  • D2Local(theLocalU: number, theLocalV: number, thePoint: gp_Pnt, theTangentU: gp_Vec, theTangentV: gp_Vec, theCurvatureU: gp_Vec, theCurvatureV: gp_Vec, theCurvatureUV: gp_Vec): void

    Calculates the point and derivatives till second order using pre-computed local parameters. This bypasses periodic normalization and local parameter calculation.

    Parameters (8)
    • theLocalU
      pre-computed local U parameter: (U - SpanMid) / SpanHalfLen
    • theLocalV
      pre-computed local V parameter: (V - SpanMid) / SpanHalfLen
    • thePoint
      the result of calculation (the point on the surface) Mutated in place; read the updated value from this argument after the call.
    • theTangentU
      tangent vector along U axis in the calculated point Mutated in place; read the updated value from this argument after the call.
    • theTangentV
      tangent vector along V axis in the calculated point Mutated in place; read the updated value from this argument after the call.
    • theCurvatureU
      curvature vector (2nd derivative on U) along U axis Mutated in place; read the updated value from this argument after the call.
    • theCurvatureV
      curvature vector (2nd derivative on V) along V axis Mutated in place; read the updated value from this argument after the call.
    • theCurvatureUV
      2nd mixed derivative on U and V Mutated in place; read the updated value from this argument after the call.

BSplSLib_EvaluatorFunction

Instance methods(1)

  • Evaluate(theDerivativeRequest: number, theUParameter: number, theVParameter: number, theResult: number, theErrorCode: number): { theResult: number; theErrorCode: number }

    Function evaluation method to be defined by descendant.

    Parameters (5)
    • theDerivativeRequest
    • theUParameter
    • theVParameter
    • theResult
    • theErrorCode
    Returns

    A result object with fields:

    • theResult: updated value from the call.
    • theErrorCode: updated value from the call.