summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/elements/polyline.py2
-rw-r--r--lib/extensions/break_apart.py10
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/elements/polyline.py b/lib/elements/polyline.py
index 5ea00508..ead2c322 100644
--- a/lib/elements/polyline.py
+++ b/lib/elements/polyline.py
@@ -49,7 +49,7 @@ class Polyline(EmbroideryElement):
def points(self):
# example: "1,2 0,0 1.5,3 4,2"
- points = self.node.get('points')
+ points = self.node.get('points').strip()
points = points.split(" ")
points = [[float(coord) for coord in point.split(",")] for point in points]
diff --git a/lib/extensions/break_apart.py b/lib/extensions/break_apart.py
index c645c7a1..b16c901d 100644
--- a/lib/extensions/break_apart.py
+++ b/lib/extensions/break_apart.py
@@ -7,7 +7,7 @@ import logging
from copy import copy
import inkex
-from shapely.geometry import LineString, MultiPolygon, Polygon
+from shapely.geometry import LinearRing, MultiPolygon, Polygon
from shapely.ops import polygonize, unary_union
from ..elements import EmbroideryElement
@@ -63,10 +63,10 @@ class BreakApart(InkstitchExtension):
for path in paths:
if len(path) < 3:
continue
- linestring = LineString(path)
- if not linestring.is_simple:
- linestring = unary_union(linestring)
- for polygon in polygonize(linestring):
+ linearring = LinearRing(path)
+ if not linearring.is_simple:
+ linearring = unary_union(linearring)
+ for polygon in polygonize(linearring):
polygons.append(polygon)
else:
polygon = Polygon(path).buffer(0)