summaryrefslogtreecommitdiff
path: root/lib/stitches/running_stitch.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2022-06-10 16:25:30 +0200
committerGitHub <noreply@github.com>2022-06-10 16:25:30 +0200
commit2fde596272b339ebb9b63ceebd66c5e7a0c641f2 (patch)
tree8beb5a62880fc66026551fca7fe4676de456029a /lib/stitches/running_stitch.py
parent68deec88a8a8c4e469191d8c00641a1077c2508a (diff)
Guided ripple stitch (#1675)
Co-authored-by: @lexelby
Diffstat (limited to 'lib/stitches/running_stitch.py')
-rw-r--r--lib/stitches/running_stitch.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/stitches/running_stitch.py b/lib/stitches/running_stitch.py
index cb8acf68..98d080ba 100644
--- a/lib/stitches/running_stitch.py
+++ b/lib/stitches/running_stitch.py
@@ -41,7 +41,8 @@ def running_stitch(points, stitch_length):
# consider sections of the original path, each one starting and ending
# with an important point
section = points[start:end + 1]
- output.append(section[0])
+ if not output or output[-1] != section[0]:
+ output.append(section[0])
# Now split each section up evenly into stitches, each with a length no
# greater than the specified stitch_length.
@@ -70,7 +71,8 @@ def running_stitch(points, stitch_length):
distance -= segment_length
segment_start = segment_end
- output.append(points[-1])
+ if points[-1] != output[-1]:
+ output.append(points[-1])
return output