[][src]Function flo_curves::bezier::fit_curve

pub fn fit_curve<Curve: BezierCurveFactory + BezierCurve>(
    points: &[Curve::Point],
    max_error: f64
) -> Option<Vec<Curve>>

Creates a bezier curve that fits a set of points with a particular error

Algorithm from Philip J. Schdeiner, Graphics Gems

There are a few modifications from the original algorithm:

  • The 'small' error used to determine if we should use Newton-Raphson is now just a multiplier of the max error
  • We only try to fit a certain number of points at once as the algorithm runs in quadratic time otherwise