Skip to main content

approximate_within

Function approximate_within 

Source
pub fn approximate_within(
    points: &[Point],
    tolerance: f64,
    tol: Tolerances,
) -> OgeomResult<Fitted<BSplineCurve>>
Expand description

Fit a B-spline to within a stated error, choosing the knots itself.

The half of fitting the fixed-count functions cannot do: the caller names how wrong the curve may be, and the fit decides how many control points that costs, refining where the error concentrates, so a profile that is straight with one tight corner gets its knots in the corner.

Returns the curve and the error actually reached. If the target could not be met with the points given, Fitted::met says so rather than the error being rounded up to success.

ยงErrors

As ogeom_geom::fit::fit_points.