summaryrefslogtreecommitdiff
path: root/lib/stitches
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stitches')
-rw-r--r--lib/stitches/auto_fill.py6
-rw-r--r--lib/stitches/contour_fill.py (renamed from lib/stitches/tangential_fill.py)1
-rw-r--r--lib/stitches/fill.py3
3 files changed, 6 insertions, 4 deletions
diff --git a/lib/stitches/auto_fill.py b/lib/stitches/auto_fill.py
index 630178c4..b3b9434f 100644
--- a/lib/stitches/auto_fill.py
+++ b/lib/stitches/auto_fill.py
@@ -59,7 +59,8 @@ def auto_fill(shape,
ending_point=None,
underpath=True):
try:
- segments = intersect_region_with_grating(shape, angle, row_spacing, end_row_spacing)
+ rows = intersect_region_with_grating(shape, angle, row_spacing, end_row_spacing)
+ segments = [segment for row in rows for segment in row]
fill_stitch_graph = build_fill_stitch_graph(shape, segments, starting_point, ending_point)
except ValueError:
# Small shapes will cause the graph to fail - min() arg is an empty sequence through insert node
@@ -390,7 +391,8 @@ def process_travel_edges(graph, fill_stitch_graph, shape, travel_edges):
def travel_grating(shape, angle, row_spacing):
- segments = intersect_region_with_grating(shape, angle, row_spacing)
+ rows = intersect_region_with_grating(shape, angle, row_spacing)
+ segments = [segment for row in rows for segment in row]
return shgeo.MultiLineString(list(segments))
diff --git a/lib/stitches/tangential_fill.py b/lib/stitches/contour_fill.py
index 833f9db3..916285d8 100644
--- a/lib/stitches/tangential_fill.py
+++ b/lib/stitches/contour_fill.py
@@ -451,7 +451,6 @@ def _interpolate_linear_rings(ring1, ring2, max_stitch_length, start=None):
points = (ring1_resampled * (1.0 - weights)) + (ring2_resampled * weights)
result = LineString(points)
- # TODO: remove when rastering is cheaper
return result.simplify(constants.simplification_threshold, False)
diff --git a/lib/stitches/fill.py b/lib/stitches/fill.py
index 94df3f77..d5a983f9 100644
--- a/lib/stitches/fill.py
+++ b/lib/stitches/fill.py
@@ -162,7 +162,7 @@ def intersect_region_with_grating(shape, angle, row_spacing, end_row_spacing=Non
runs.reverse()
runs = [tuple(reversed(run)) for run in runs]
- yield from runs
+ yield runs
if end_row_spacing:
current_row_y += row_spacing + \
@@ -225,6 +225,7 @@ def pull_runs(rows, shape, row_spacing):
# print >>sys.stderr, "\n".join(str(len(row)) for row in rows)
+ rows = list(rows)
runs = []
count = 0
while (len(rows) > 0):