Function kurbo::fit_to_bezpath_opt

source ·
pub fn fit_to_bezpath_opt(source: &impl ParamCurveFit, accuracy: f64) -> BezPath
Expand description

Generate a highly optimized Bézier path that fits the source curve.

This function is still experimental and the signature might change; it’s possible it might become a method on the ParamCurveFit trait.

This function is considerably slower than fit_to_bezpath, as it computes optimal subdivision points. Its result is expected to be very close to the optimum possible Bézier path for the source curve, in that it has a minimal number of curve segments, and a minimal error over all paths with that number of segments.

See fit_to_bezpath for an explanation of the accuracy parameter.