diff options
Diffstat (limited to 'lib/elements')
| -rw-r--r-- | lib/elements/clone.py | 9 | ||||
| -rw-r--r-- | lib/elements/polyline.py | 2 | ||||
| -rw-r--r-- | lib/elements/satin_column.py | 4 |
3 files changed, 12 insertions, 3 deletions
diff --git a/lib/elements/clone.py b/lib/elements/clone.py index 5100def1..fdcd6835 100644 --- a/lib/elements/clone.py +++ b/lib/elements/clone.py @@ -6,6 +6,7 @@ from math import atan2, degrees, radians from inkex import CubicSuperPath, Path, Transform +from shapely import MultiLineString from ..commands import is_command_symbol from ..i18n import _ @@ -142,6 +143,14 @@ class Clone(EmbroideryElement): center = self.node.bounding_box(transform).center return center + @property + def shape(self): + path = self.node.get_path() + transform = Transform(self.node.composed_transform()) + path = path.transform(transform) + path = path.to_superpath() + return MultiLineString(path) + def validation_warnings(self): source_node = get_clone_source(self.node) if source_node.tag not in EMBROIDERABLE_TAGS: diff --git a/lib/elements/polyline.py b/lib/elements/polyline.py index a33b75de..4bc71dc0 100644 --- a/lib/elements/polyline.py +++ b/lib/elements/polyline.py @@ -49,7 +49,7 @@ class Polyline(EmbroideryElement): @property @cache def shape(self): - return shgeo.LineString(self.path) + return shgeo.MultiLineString(self.csp[0]) @property def path(self): diff --git a/lib/elements/satin_column.py b/lib/elements/satin_column.py index 40fc27be..3daf1085 100644 --- a/lib/elements/satin_column.py +++ b/lib/elements/satin_column.py @@ -684,10 +684,10 @@ class SatinColumn(EmbroideryElement): if len(self.csp) < 2: yield TooFewPathsError((0, 0)) elif len(self.rails) < 2: - yield TooFewPathsError(self.shape.centroid) + yield TooFewPathsError(self.flattened_rails[0].representative_point()) if not self.to_stitch_groups(): - yield NotStitchableError(self.shape.centroid) + yield NotStitchableError(self.flattened_rails[0].representative_point()) def _center_walk_is_odd(self): return self.center_walk_underlay_repeats % 2 == 1 |
