Function svg_path_ops::normalize

source ·
pub fn normalize(
    path_segments: impl Iterator<Item = impl Borrow<PathSegment>>
) -> impl Iterator<Item = PathSegment>
Expand description

Normalize takes a list of absolute segments and outputs a list of segments with only four commands: M, L, C, Z. So every segment is described as move, line, or a bezier curve (cubic). This is useful when translating SVG paths to non SVG mediums - Canvas, or some other graphics platform. Most such platforms will support lines and bezier curves. It also simplifies the cases to consider when modifying these segments.