svg_path_editor.path_round_corners#
Functions#
|
Round corners between straight segments in closed subpaths. |
Module Contents#
- svg_path_editor.path_round_corners.round_corners(path, radius, *, selector=lambda a, b, c: ...)[source]#
Round corners between straight segments in closed subpaths.
The input must be one or more closed subpaths
M … Z. Each corner between two straight segments (L/H/V/Z) at point \(B\) between \(AB\) and \(BC\) is replaced by:a shortened segment from \(A\) to \(P\) on \(AB\),
a circular arc from \(P\) to \(Q\) with radius
radius,a shortened segment from \(Q\) to \(C\) on \(BC\).
Only corners with straight incoming and outgoing segments are modified. The input path is not modified.
- Parameters:
- Returns:
New
SvgPathwith chosen line-line corners rounded by arcs.- Raises:
ValueError – If
radiusis not positive.- Return type: