NURBSCurve constructor
NURBSCurve(
- dynamic degree,
- dynamic knots,
- dynamic controlPoints,
- dynamic startKnot,
- dynamic endKnot,
Implementation
NURBSCurve(
degree,
knots /* array of reals */,
controlPoints /* array of Vector(2|3|4) */,
startKnot /* index in knots */,
endKnot /* index in knots */
) : super() {
this.degree = degree;
this.knots = knots;
this.controlPoints = [];
// Used by periodic NURBS to remove hidden spans
this.startKnot = startKnot ?? 0;
this.endKnot = endKnot ?? ( this.knots.length - 1 );
for ( var i = 0; i < controlPoints.length; ++ i ) {
// ensure Vector4 for control points
var point = controlPoints[ i ];
this.controlPoints[ i ] = new Vector4( point.x, point.y, point.z, point.w );
}
}