svg_path/degeneracy
Degenerate and nearly-degenerate geometry cleanup.
Types
Errors returned by degeneracy cleanup helpers.
pub type Error {
PathError(svg_path.Error)
ConvexHullError(convex_hull.Error)
}
Constructors
-
PathError(svg_path.Error)An underlying path operation failed.
-
ConvexHullError(convex_hull.Error)Convex-hull construction failed while normalizing degenerate segments.
Values
pub fn normalize_degenerate_segments(
subpath: svg_path.Subpath,
tolerance tolerance: Float,
) -> Result(svg_path.Subpath, Error)
Replace maximal contiguous line-degenerate windows in a subpath.
Each selected window is replaced by its ordered line traversal. Windows are considered from left to right. Their exact curve-preserving convex hull is grown one segment at a time, and the largest prefix certified to fit in a strip of the requested width is selected first.