diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2022-06-30 19:22:33 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-30 19:22:33 +0200 |
| commit | 8d5ef5b6635b5b84f12409b535114853954680d1 (patch) | |
| tree | c963bf0e1ddc4ee584c08b4014232f0f067ae512 /lib/stitches/auto_fill.py | |
| parent | 725281f075f8d40a68427733f377983b6f7c607b (diff) | |
Fixes (#1703)
* guide line position
* use direction from line to shape
* optimize intersection detection
* fix flapack elf
* handle weird guide lines better
* update starting point for self crossing (multiple) fills
* ripple: fixes and non circular join style
* avoid jumps in ripple stitch
* fallback only necessary if shape does not intersect grating
* make valid may return a polygon
* add profiling
* Stitch.__init__ didn't work right and was super slow
* shrink or grow to multipolygon
Co-authored-by: Lex Neva
Diffstat (limited to 'lib/stitches/auto_fill.py')
| -rw-r--r-- | lib/stitches/auto_fill.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/stitches/auto_fill.py b/lib/stitches/auto_fill.py index ac1e477b..3ff5a24f 100644 --- a/lib/stitches/auto_fill.py +++ b/lib/stitches/auto_fill.py @@ -59,14 +59,14 @@ def auto_fill(shape, starting_point, ending_point=None, underpath=True): - try: - 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 + rows = intersect_region_with_grating(shape, angle, row_spacing, end_row_spacing) + if not rows: + # Small shapes may not intersect with the grating at all. return fallback(shape, running_stitch_length, running_stitch_tolerance) + segments = [segment for row in rows for segment in row] + fill_stitch_graph = build_fill_stitch_graph(shape, segments, starting_point, ending_point) + if not graph_is_valid(fill_stitch_graph, shape, max_stitch_length): return fallback(shape, running_stitch_length, running_stitch_tolerance) |
