summaryrefslogtreecommitdiff
path: root/lib/stitches/guided_fill.py
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2023-02-05 22:33:38 -0500
committerLex Neva <github.com@lexneva.name>2023-02-16 22:56:16 -0500
commitf6c2aa89197c82cedfb31465fc4b2acffaeb8f25 (patch)
tree1123050a6ba7428dbcc8b72bd074161bdb3e014f /lib/stitches/guided_fill.py
parent62b7c0080c90d0cf44ee173db7d1f237e8df538e (diff)
add more check_stop_flag() calls
Diffstat (limited to 'lib/stitches/guided_fill.py')
-rw-r--r--lib/stitches/guided_fill.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/stitches/guided_fill.py b/lib/stitches/guided_fill.py
index a9906bfb..4c441b32 100644
--- a/lib/stitches/guided_fill.py
+++ b/lib/stitches/guided_fill.py
@@ -15,6 +15,7 @@ from ..utils.geometry import (ensure_geometry_collection,
from .auto_fill import (auto_fill, build_fill_stitch_graph, build_travel_graph,
collapse_sequential_outline_edges, find_stitch_path,
graph_is_valid, travel)
+from ..utils.threading import check_stop_flag
def guided_fill(shape,
@@ -68,6 +69,8 @@ def path_to_stitches(path, travel_graph, fill_stitch_graph, stitch_length, runni
stitches.append(Stitch(*path[0].nodes[0]))
for edge in path:
+ check_stop_flag()
+
if edge.is_segment():
current_edge = fill_stitch_graph[edge[0]][edge[-1]]['segment']
path_geometry = current_edge['geometry']
@@ -233,6 +236,8 @@ def intersect_region_with_grating_guideline(shape, line, row_spacing, num_stagge
offset_line = None
rows = []
while True:
+ check_stop_flag()
+
if strategy == 0:
translate_amount = translate_direction * row * row_spacing
offset_line = translate(line, xoff=translate_amount.x, yoff=translate_amount.y)