summaryrefslogtreecommitdiff
path: root/lib/stitches/running_stitch.py
diff options
context:
space:
mode:
authorGeorge Steel <george.steel@gmail.com>2023-01-22 19:54:57 -0500
committerGeorge Steel <george.steel@gmail.com>2023-01-22 20:01:43 -0500
commit9f787a661efd2f4336cef0233ee5a2046eb96dd3 (patch)
treea2b10383cfb70790efa4ef85275a8c640bf02e9f /lib/stitches/running_stitch.py
parenteb3d6bbcc13d749745271eb0b2a8b6cba938ac19 (diff)
add missing bounds check
Diffstat (limited to 'lib/stitches/running_stitch.py')
-rw-r--r--lib/stitches/running_stitch.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/stitches/running_stitch.py b/lib/stitches/running_stitch.py
index 49d29c72..66f903e0 100644
--- a/lib/stitches/running_stitch.py
+++ b/lib/stitches/running_stitch.py
@@ -209,6 +209,8 @@ def stitch_curve_even(points: typing.Sequence[Point], stitch_length: float, tole
def path_to_curves(points: typing.List[Point]):
# split a path at obvious corner points so that they get stitched exactly
+ if len(points) < 3:
+ return [points]
curves = []
last = 0
last_seg = points[1] - points[0]