summaryrefslogtreecommitdiff
path: root/lib/stitches/running_stitch.py
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2023-02-16 22:58:10 -0500
committerGitHub <noreply@github.com>2023-02-16 22:58:10 -0500
commit7aee0979be4f39cde7a6396cdc0d1d2cc4222d90 (patch)
tree1123050a6ba7428dbcc8b72bd074161bdb3e014f /lib/stitches/running_stitch.py
parent30c73dc39c1ac814d0c63ec102c7f8c2b993fdd0 (diff)
parentf6c2aa89197c82cedfb31465fc4b2acffaeb8f25 (diff)
Merge pull request #2045 from inkstitch/lexelby/interruptible-threads
make simulator threads interruptible
Diffstat (limited to 'lib/stitches/running_stitch.py')
-rw-r--r--lib/stitches/running_stitch.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/stitches/running_stitch.py b/lib/stitches/running_stitch.py
index c1c2d99c..8ba53498 100644
--- a/lib/stitches/running_stitch.py
+++ b/lib/stitches/running_stitch.py
@@ -12,6 +12,7 @@ import numpy as np
from shapely import geometry as shgeo
from ..utils import prng
from ..utils.geometry import Point
+from ..utils.threading import check_stop_flag
""" Utility functions to produce running stitches. """
@@ -196,6 +197,8 @@ def stitch_curve_evenly(points: typing.Sequence[Point], stitch_length: float, to
last = points[0]
stitches = []
while i is not None and i < len(points):
+ check_stop_flag()
+
d = last.distance(points[i]) + distLeft[i]
if d == 0:
return stitches