Refactor paths
Overview:
Vector2d
-
🆕 inkex.transforms.Vector2d
represents Cartesian 2d vector (100% test coverage)
Path Commands
-
paths.Segment
renamed topaths.PathCommand
-
paths.PathCommand
hierarchy changed fromline->Line->Segment
toline->RelativePathCommand->PathCommand
Line->AbsolutePathCommand->PathCommand
-
PathCommand
is invariant with respect to any transformation (exception:Vect/Horz
are converted toLine
) - Implicit conversions between different path commands is prohibited
-
end_point
andcontrol_points
methods are available to get last pen point or all control points of path command
Path and CubicSuperPath
segment ofCubicSuperPath
is extracted asCubicPath
class.CubicPath
is intended to replace list of "triplets of control points". To avoid immediate rewrite of "triplet"-based code.to_triplets()
methods are available.- Operational transformations of
Path
are removed in favor of dedicated methods:Path() + (10,20)
->Path().translate(10, 20)
. Inplace transformation ofPath
requiresinplace=True
argument. -
end_points
andcontrol_points
properties are available forPath
to avoid manual error-prone path traversals in user code. CubicSuperPath
is not derived fromlist
Edited by Martin Owens