svg_path_editor.path_change_origin#
Functions#
|
Return a new path where the origin of a (sub)path is moved. |
Module Contents#
- svg_path_editor.path_change_origin.change_path_origin(svg, new_origin_index, subpath=None)[source]#
Return a new path where the origin of a (sub)path is moved.
The command at
new_origin_indexbecomes the first command of the affected subpath segment; all items of that subpath are rotated accordingly. IfsubpathisTrue, only the subpath containingnew_origin_indexis transformed; ifFalse/None, the whole path is treated as a single segment.- Parameters:
svg (SvgPath) – Original path to transform.
new_origin_index (int) – Index of the command that should become the new origin within its subpath.
subpath (bool | None) – If
True, restrict the change to the subpath containingnew_origin_index; ifFalseorNone, treat the full path segment as one subpath.
- Returns:
A new
SvgPathinstance with the origin moved and the path representation optimized.- Return type: