summaryrefslogtreecommitdiff
path: root/lib/stitches
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2024-07-24 16:01:34 +0200
committerGitHub <noreply@github.com>2024-07-24 16:01:34 +0200
commit3c37c52ab1b088676c3267c7d830d8381d269ca3 (patch)
treeaee6193983d670e2364be3b6933a14dd20143f38 /lib/stitches
parent1b09fdbddbe4aeea79dcefc93ecd91047696ff06 (diff)
not a fix, but avoid to fail on an other networkx no path error (#3106)
Diffstat (limited to 'lib/stitches')
-rw-r--r--lib/stitches/auto_fill.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/stitches/auto_fill.py b/lib/stitches/auto_fill.py
index 7e98e434..a1e88d5d 100644
--- a/lib/stitches/auto_fill.py
+++ b/lib/stitches/auto_fill.py
@@ -869,7 +869,14 @@ def travel(shape, travel_graph, edge, running_stitch_length, running_stitch_tole
"""Create stitches to get from one point on an outline of the shape to another."""
start, end = edge
- path = networkx.shortest_path(travel_graph, start, end, weight='weight')
+ try:
+ path = networkx.shortest_path(travel_graph, start, end, weight='weight')
+ except networkx.NetworkXNoPath:
+ # TODO: find a better solution, this may produce unwanted jump stitches
+ # but at least it renders the requested shape
+ # test case: underpath disabled, starts and ends on different outlines
+ return
+
if underpath and path != (start, end):
path = smooth_path(path, 2)
else: