Skip to main content

interpolate_curve

Function interpolate_curve 

Source
pub fn interpolate_curve(
    points: &[Vec3],
    degree: usize,
    parameters: &[f64],
) -> Result<NurbsCurve, String>
Expand description

Global B-spline interpolation (The NURBS Book A9.1) through points at the supplied strictly increasing parameters.

The result is CLAMPED over exactly [parameters[0], parameters[n]] — the caller’s own parameter interval, not a normalized [0, 1]. A9.1’s end knots are ū_0 and ū_n; hardcoding 0.0/1.0 there is only correct when the caller already normalized, and silently emits a knot vector that DESCENDS at the clamp when it did not (STEP import’s reconcile_edges_onto_surfaces re-fits an edge over its own domain — on ABC 00000290 that is [1.0, 1.2499], producing interior knots up to 1.234 followed by the four 1.0 end knots, i.e. a 0.234 descent that validate_knots rightly rejected). Since the averaged interior knots always lie strictly between parameters[0] and parameters[n], taking the ends from the parameters makes the vector valid for ANY strictly increasing input, and is bit-identical for the already- normalized callers.