summaryrefslogtreecommitdiff
path: root/lib/elements/stroke.py
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2022-05-20 12:06:31 -0400
committerGitHub <noreply@github.com>2022-05-20 12:06:31 -0400
commit8ab4abf190778867a8eccde08733c45f3760b2d0 (patch)
treef5b63f5e192c36d8c6bf47e4c30c68d8b1a73728 /lib/elements/stroke.py
parent1316e8132e58361f42cb4315c586e0e2cccfc64c (diff)
parent47123198760f8740acda0799d3b22f14b3f69550 (diff)
Merge pull request #1548 from inkstitch/feature_guided_fill
Feature guided fill
Diffstat (limited to 'lib/elements/stroke.py')
-rw-r--r--lib/elements/stroke.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/elements/stroke.py b/lib/elements/stroke.py
index 6f8d8bb1..7113bf3f 100644
--- a/lib/elements/stroke.py
+++ b/lib/elements/stroke.py
@@ -168,6 +168,10 @@ class Stroke(EmbroideryElement):
for i in range(len(patch) - 1):
start = patch.stitches[i]
end = patch.stitches[i + 1]
+ # sometimes the stitch results into zero length which cause a division by zero error
+ # ignoring this leads to a slightly bad result, but that is better than no output
+ if (end - start).length() == 0:
+ continue
segment_direction = (end - start).unit()
zigzag_direction = segment_direction.rotate_left()