summaryrefslogtreecommitdiff
path: root/lib/elements/fill.py
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2018-09-01 20:06:39 -0400
committerLex Neva <github.com@lexneva.name>2018-09-01 20:11:01 -0400
commit1c2dc2d95442b3663eebf1e2b633f3bb388982c0 (patch)
tree816395749b2968d9fa4602b0fd48a5cbb3351c5e /lib/elements/fill.py
parentc3d6780bf172cc8fc1a5c35a9fde73e101d37e78 (diff)
add error message for invalid geometries (#216)
Diffstat (limited to 'lib/elements/fill.py')
-rw-r--r--lib/elements/fill.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/elements/fill.py b/lib/elements/fill.py
index 626573e6..4156a24b 100644
--- a/lib/elements/fill.py
+++ b/lib/elements/fill.py
@@ -120,7 +120,10 @@ class Fill(EmbroideryElement):
poly_ary.sort(key=lambda point_list: shgeo.Polygon(point_list).area, reverse=True)
polygon = shgeo.MultiPolygon([(poly_ary[0], poly_ary[1:])])
- # print >> sys.stderr, "polygon valid:", polygon.is_valid
+
+ if not polygon.is_valid:
+ self.fatal(_("shape is not valid. This can happen if the border crosses over itself."))
+
return polygon
def to_patches(self, last_patch):