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