summaryrefslogtreecommitdiff
path: root/lib/stitches/auto_fill.py
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2021-08-16 19:40:44 -0400
committerGitHub <noreply@github.com>2021-08-16 19:40:44 -0400
commit3ebc238561dd2403b19a56a0f3147c70eb4ebe3d (patch)
treec7e4c618335fac2196d42e03f26c3c2ad2a4251d /lib/stitches/auto_fill.py
parent5a7b7276759b6fb4c85891b13d9ee7a2da8150ab (diff)
parentb49f7d28314f30727f9f963bddb795b88a95f2bd (diff)
Merge pull request #1254 from inkstitch/kaalleen/satin-patterns
Satin pattern and split stitch
Diffstat (limited to 'lib/stitches/auto_fill.py')
-rw-r--r--lib/stitches/auto_fill.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/stitches/auto_fill.py b/lib/stitches/auto_fill.py
index 07361f13..160d927e 100644
--- a/lib/stitches/auto_fill.py
+++ b/lib/stitches/auto_fill.py
@@ -14,6 +14,7 @@ from shapely.ops import snap
from shapely.strtree import STRtree
from ..debug import debug
+from ..stitch_plan import Stitch
from ..svg import PIXELS_PER_MM
from ..utils.geometry import Point as InkstitchPoint
from ..utils.geometry import line_string_to_point_list
@@ -592,9 +593,12 @@ def travel(travel_graph, start, end, running_stitch_length, skip_last):
"""Create stitches to get from one point on an outline of the shape to another."""
path = networkx.shortest_path(travel_graph, start, end, weight='weight')
- path = [InkstitchPoint(*p) for p in path]
+ path = [Stitch(*p) for p in path]
stitches = running_stitch(path, running_stitch_length)
+ for stitch in stitches:
+ stitch.add_tag('auto_fill_travel')
+
# The path's first stitch will start at the end of a row of stitches. We
# don't want to double that last stitch, so we'd like to skip it.
if skip_last and len(path) > 2:
@@ -619,7 +623,7 @@ def path_to_stitches(path, travel_graph, fill_stitch_graph, angle, row_spacing,
# If the very first stitch is travel, we'll omit it in travel(), so add it here.
if not path[0].is_segment():
- stitches.append(InkstitchPoint(*path[0].nodes[0]))
+ stitches.append(Stitch(*path[0].nodes[0]))
for edge in path:
if edge.is_segment():