pub fn fit_points_closed(
points: &[Point],
degree: usize,
tolerance: f64,
tol: Tolerances,
) -> OgeomResult<Fitted<BSplineCurve>>Expand description
Fit a smoothly closed loop: as fit_points, with the join C1.
The input must be a loop (the first point repeated at the end), and the ends are honoured exactly as always. Beyond that, the tangent leaving the join is constrained to equal the tangent arriving at it, eliminated exactly inside the least-squares solve rather than patched on after, so a surface built over the loop shows no crease at the seam.
The constraint spends shape freedom at the join: the last movable control
point follows the first, so a loop fits with slightly more knots than the
same data fitted open, and the tightest reachable error is a little
higher. That is the price of the join being smooth, and it is why this is
a separate entry rather than a change to fit_points.
ยงErrors
As fit_points, and additionally if the input is not a closed loop.