pub fn expand_path(
path: impl Shape,
expand: Diagonal2,
join: Join,
miter_limit: f64,
tolerance: f64,
) -> BezPathExpand description
Expand a path.
Expands a filled path by the expansion, which allows separate x and y factors. The path (and the result) is interpreted according to the nonzero winding rule. Both factors should be positive. A negative expansion will shrink the path but is also likely to leave intersection artifacts at corners.
The direction of the expansion is based on the signed area of the overall path. This should give expected results most of the time, but there are exceptions. For a figure-eight path, one lobe will be expanded and the other shrunk. Similarly if there are two disjoint subpaths with opposite winding.
The tolerance is mostly for joins and robustness; it is not used to guide subdivision. Rather, each Bézier segment in the input generally results in one cubic Bézier in the output. Thus, it is not expected to work well when the expansion factor is large compared with the radius of curvature on the input.