Creates a NURBS curve from degree, knots, control points, and optional weights.
When weights is omitted, all control points receive a weight of 1.0
(non-rational B-spline).
Polynomial degree p of the basis functions
Non-decreasing knot vector of length n + p + 1
Control points in curve order
Optionalweights: number[]Optional rational weights aligned with control points
Return a deep-cloned copy of this NURBS curve.
Get the control points
Evaluates position and parametric derivatives at parameter u.
Returns the rational NURBS point together with first- and second-order parametric derivatives computed analytically from the basis functions.
Curve parameter in the valid knot span
Position point, first derivative deriv1, and second derivative deriv2
Samples a 2D path with analytic tangents for planar offset.
Builds an initial uniform parameter list scaled by curve length and offset
distance, then refines intervals where |offsetDist| * |curvature| exceeds
0.85 (potential cusp region). Each final sample includes a unit tangent
derived from the analytic first derivative.
Signed offset distance used to choose sample density
Upper bound on the number of returned samples (default 512)
XY samples and matching unit tangents in parameter order
Returns the nearest point on this NURBS curve to the given point.
Evaluates the curve at uniform steps in parameter space over the valid knot span.
Query point.
Number of interior samples (default 64).
Calculates a point on the curve at parameter u.
Delegates to evaluate and returns only the position component.
Curve parameter in the valid knot span
Evaluated point as [x, y, z]
Signed curvature in the XY plane at parameter u.
Uses the standard planar formula
(x'y'' - y'x'') / (x'^2 + y'^2)^(3/2) applied to the parametric
derivatives from evaluate.
Curve parameter in the valid knot span
Signed curvature; positive indicates counterclockwise bending
StaticbyCreate a NURBS curve from control points and knots
Optionalweights: number[]StaticbyCreate a NURBS curve from fit points using interpolation
OptionalstartTangent: number[]OptionalendTangent: number[]StaticcreateCreate a closed NURBS curve using Catmull-Rom interpolation for smooth closure
StaticcreateCreate fit points for a closed NURBS curve using Catmull-Rom interpolation
A NURBS curve implementation that can be used by other curve classes