From 2fde596272b339ebb9b63ceebd66c5e7a0c641f2 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Fri, 10 Jun 2022 16:25:30 +0200 Subject: Guided ripple stitch (#1675) Co-authored-by: @lexelby --- lib/stitches/running_stitch.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib/stitches/running_stitch.py') 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 -- cgit v1.2.3