diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2024-07-16 20:39:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-16 20:39:33 +0200 |
| commit | eadeadb9a6bbb11c7f7e5ff49e9f430ce0e68cfe (patch) | |
| tree | 76065cdeaa3308c969c61cd887f0cf5502cc9501 | |
| parent | d9ed17d888c6e2324d653e50baf2057c49059512 (diff) | |
Fill: fallback to edge run when underpath fails (#3089)
| -rw-r--r-- | lib/stitches/auto_fill.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/stitches/auto_fill.py b/lib/stitches/auto_fill.py index 963d686d..d3072df3 100644 --- a/lib/stitches/auto_fill.py +++ b/lib/stitches/auto_fill.py @@ -428,21 +428,24 @@ def build_travel_graph(fill_stitch_graph, shape, fill_stitch_angle, underpath): # They'll all already have their `outline` and `projection` tags set. graph.add_nodes_from(fill_stitch_graph.nodes(data=True)) + grating = True if underpath: try: boundary_points, travel_edges = build_travel_edges(shape, fill_stitch_angle) except NoGratingsError: - return + grating = False - # This will ensure that a path traveling inside the shape can reach its - # target on the outline, which will be one of the points added above. - tag_nodes_with_outline_and_projection(graph, shape, boundary_points) - else: + if grating: + # This will ensure that a path traveling inside the shape can reach its + # target on the outline, which will be one of the points added above. + tag_nodes_with_outline_and_projection(graph, shape, boundary_points) + + if not underpath or not grating: add_boundary_travel_nodes(graph, shape) add_edges_between_outline_nodes(graph) - if underpath: + if underpath and grating: process_travel_edges(graph, fill_stitch_graph, shape, travel_edges) debug.log_graph(graph, "travel graph") |
