summaryrefslogtreecommitdiff
path: root/embroider.py
diff options
context:
space:
mode:
authorStefan Siegl <stesie@brokenpipe.de>2014-12-26 23:26:06 +0100
committerStefan Siegl <stesie@brokenpipe.de>2014-12-26 23:26:06 +0100
commitea07ab6f108f4ec4af3fec43104e0467e206b92e (patch)
tree706e44e642a68d3c3bd3e4a9f94bb4e249ec8581 /embroider.py
parent47449d22cb9ef299d6cd9d8661e4d1f5fcb09f2a (diff)
Handle closed paths
Diffstat (limited to 'embroider.py')
-rw-r--r--embroider.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/embroider.py b/embroider.py
index c9c30039..e5bf2501 100644
--- a/embroider.py
+++ b/embroider.py
@@ -615,11 +615,14 @@ class Embroider(inkex.Effect):
emb_point_list = []
for (type,points) in path:
- dbg.write("path_to_patch_list parses pt %s\n" % points)
- pointscopy = list(points)
- while (len(pointscopy)>0):
- emb_point_list.append(PyEmb.Point(pointscopy[0], pointscopy[1]))
- pointscopy = pointscopy[2:]
+ dbg.write("path_to_patch_list parses pt %s with type=%s\n" % (points, type))
+ if type == 'Z':
+ emb_point_list.append(emb_point_list[0])
+ else:
+ pointscopy = list(points)
+ while (len(pointscopy)>0):
+ emb_point_list.append(PyEmb.Point(pointscopy[0], pointscopy[1]))
+ pointscopy = pointscopy[2:]
STROKE_MIN = 0.5 # a 0.5pt stroke becomes a straight line.
if (stroke_width <= STROKE_MIN):