Skip to main content

fit_surface_scattered_at

Function fit_surface_scattered_at 

Source
pub fn fit_surface_scattered_at(
    points: &[Point],
    parameters: &[(f64, f64)],
    u_knots: &KnotVector,
    v_knots: &KnotVector,
    fairing: f64,
    tol: Tolerances,
) -> OgeomResult<Fitted<BSplineSurface>>
Expand description

Fit a surface to scattered points at parameters the caller chose, over the caller’s knot vectors, faired by the thin-plate energy.

Where fit_surface_scattered reads the parameters off the cloud’s principal plane, here they come from a chart of the caller’s: one that unfolds a region the principal plane would fold over. The control net minimises the mean squared distance from each point to the surface at its parameters plus fairing times the thin-plate energy, the integral of |S_uu|² + 2|S_uv|² + |S_vv|² over the whole knot domain. The energy settles the controls no point reaches (a span the points leave empty, a margin past them) on the smoothest continuation of the rest. The reported error is the largest distance from any point to the surface at its parameters; met is always true, there being no target.

The normal equations are banded (a control couples only to those within a degree of it in each direction), and are solved in that band.

§Errors

OgeomError::Construction if the points and parameters differ in number, there are fewer than four, a parameter lies outside the knot domain, or the weight is not finite and non-negative; OgeomError::Numeric if the system is singular.