pub fn simplify_bezpath(
path: impl IntoIterator<Item = PathEl>,
accuracy: f64,
options: &SimplifyOptions,
) -> BezPath
Expand description
Simplify a Bézier path.
This function simplifies an arbitrary Bézier path; it is designed to handle multiple subpaths and also corners.
The underlying curve-fitting approach works best if the source path is very smooth. If it contains higher frequency noise, then results may be poor, as the resulting curve matches the original with G1 continuity at each subdivision point, and also preserves the area. For such inputs, consider some form of smoothing or low-pass filtering before simplification. In particular, if the input is derived from a sequence of points, consider fitting a smooth spline.
We may add such capabilities in the future, possibly as opt-in smoothing specified through the options.