diff options
| author | Lex Neva <github.com@lexneva.name> | 2019-03-30 22:20:46 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2019-03-30 22:20:46 -0400 |
| commit | f5f0ce49a8db1445feba91e629e6b02584dbd05b (patch) | |
| tree | 76ccfee3eab5e2e74b21320e822f68ef3a199090 /lib/stitches/auto_fill.py | |
| parent | 37722b7ddf8b1f612408bea783d9ac5455f7b9fd (diff) | |
fix 'too many values to unpack' exception
Diffstat (limited to 'lib/stitches/auto_fill.py')
| -rw-r--r-- | lib/stitches/auto_fill.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/stitches/auto_fill.py b/lib/stitches/auto_fill.py index 917b09a8..8bfbd092 100644 --- a/lib/stitches/auto_fill.py +++ b/lib/stitches/auto_fill.py @@ -252,7 +252,12 @@ def build_travel_graph(fill_stitch_graph, shape, fill_stitch_angle, underpath): outline = shape.boundary.simplify(0.5 * PIXELS_PER_MM, preserve_topology=False) for ls in travel_edges: - p1, p2 = [InkstitchPoint(*coord) for coord in ls.coords] + # In most cases, ls will be a simple line segment. If we're + # unlucky, in rare cases we can get a tiny little extra squiggle + # at the end that can be ignored. + points = [InkstitchPoint(*coord) for coord in ls.coords] + p1, p2 = points[0], points[-1] + edge = (p1.as_tuple(), p2.as_tuple(), 'travel') for segment in strtree.query(ls): |
