BSpline1dNd Class

Bspline knots and poles for 1d-to-Nd.

  • The "pole" (aka control point) of this class is a block of poleLength numbers.
  • Derived classes (not this class) assign meaning such as x,y,z,w.
  • for instance, an instance of this class with poleLength===3 does not know if its poles are x,y,z or weighted 2D x,y,w

Methods

Name Description
constructor(numPoles: number, poleLength: number, order: number, knots: KnotVector): BSpline1dNd Protected initialize arrays for given spline dimensions.  
addKnot(knot: number, totalMultiplicity: number): boolean Insert knot and resulting pole into the instance, optionally multiple times.  
evaluateBasisFunctionsInSpan(spanIndex: number, spanFraction: number, f: Float64Array, df?: Float64Array, ddf?: Float64Array): boolean Evaluate the order basis functions (and optionally one or two derivatives) at a given fractional position within indexed span.  
evaluateBuffersAtKnot(u: number, numDerivative: number0): void Evaluate the function values and 1 or 2 derivatives into this.poleBuffer, this.poleBuffer1 and this.poleBuffer2  
evaluateBuffersInSpan(spanIndex: number, spanFraction: number): void * Evaluate the basis functions at spanIndex and fraction.  
evaluateBuffersInSpan1(spanIndex: number, spanFraction: number): void * Evaluate the basis functions and one derivative at spanIndex and fraction.  
getPoint3dPole(i: number, result?: Point3d): undefined | Point3d copy 3 values of pole i into a point.  
reverseInPlace(): void Reverse the (blocked) poles (in this.packedData in place.  
spanFractionToKnot(span: number, localFraction: number): number Map a span index and local fraction to knot value.  
sumPoleBuffer1ForSpan(spanIndex: number): void sum poles in poleBuffer1 at span spanIndex by the weights in the basisBuffer1, i.e.  
sumPoleBuffer2ForSpan(spanIndex: number): void sum poles in poleBuffer2 at span spanIndex by the weights in the basisBuffer2, i.e.  
sumPoleBufferForSpan(spanIndex: number): void sum poles in poleBuffer at span spanIndex by the weights in the basisBuffer  
testClosablePolygon(mode?: BSplineWrapMode): boolean Test if the leading and trailing polygon coordinates are replicated in the manner of a "closed" bspline polygon which has been expanded  
testCloseablePolygon(mode?: BSplineWrapMode): boolean Test if the leading and trailing polygon coordinates are replicated in the manner of a "closed" bspline polygon which has been expanded Deprecated  
create(numPoles: number, poleLength: number, order: number, knots: KnotVector): undefined | BSpline1dNd Static create a 1Bspline1dNd`  

Properties

Name Type Description
basisBuffer Float64Array preallocated array (length === order) used as temporary in evaluations  
basisBuffer1 Float64Array preallocated array (length === order) used as temporary in evaluations  
basisBuffer2 Float64Array preallocated array (length === order) used as temporary in evaluations  
degree Accessor ReadOnly number (property accessor) Return the degree of the polynomials.  
knots KnotVector knots of the bspline  
numPoles Accessor ReadOnly number (property accessor) Return the number of poles  
numSpan Accessor ReadOnly number (property accessor) Return the number of bezier spans (including null spans at multiple knots)  
order Accessor ReadOnly number (property accessor) Return the number of order (one more than degree) of the polynomials  
packedData Float64Array poles, packed in blocks of poleLength doubles.  
poleBuffer Float64Array preallocated array (length === poleLength) used as temporary in evaluations  
poleBuffer1 Float64Array preallocated array (length === poleLength) used as temporary in evaluations  
poleBuffer2 Float64Array preallocated array (length === poleLength) used as temporary in evaluations  
poleLength number (property accessor) Return the number of numeric values per pole.  

Defined in

Last Updated: 28 October, 2024