diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2024-03-29 10:25:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-29 10:25:02 +0100 |
| commit | 2439adafa8592995d9acead47ef2802d5d95c373 (patch) | |
| tree | bfa10aaf017bc48cf6c166c7adeb9afd5dc12922 /lib/stitches/guided_fill.py | |
| parent | fb1ecd0badf5eb142f17cc7f0f7e8b347151b002 (diff) | |
Add "the tartan universe" (#2782)
Diffstat (limited to 'lib/stitches/guided_fill.py')
| -rw-r--r-- | lib/stitches/guided_fill.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/stitches/guided_fill.py b/lib/stitches/guided_fill.py index 6f650028..bc7a3ab2 100644 --- a/lib/stitches/guided_fill.py +++ b/lib/stitches/guided_fill.py @@ -43,7 +43,7 @@ def guided_fill(shape, if is_empty(fill_stitch_graph): return fallback(shape, guideline, row_spacing, max_stitch_length, running_stitch_length, running_stitch_tolerance, num_staggers, skip_last, starting_point, ending_point, underpath) - fill_stitch_graph = graph_make_valid(fill_stitch_graph) + graph_make_valid(fill_stitch_graph) travel_graph = build_travel_graph(fill_stitch_graph, shape, angle, underpath) path = find_stitch_path(fill_stitch_graph, travel_graph, starting_point, ending_point) @@ -156,14 +156,14 @@ def take_only_line_strings(thing): return shgeo.MultiLineString(line_strings) -def apply_stitches(line, max_stitch_length, num_staggers, row_spacing, row_num, threshold=None): +def apply_stitches(line, max_stitch_length, num_staggers, row_spacing, row_num, threshold=None) -> shgeo.LineString: if num_staggers == 0: num_staggers = 1 # sanity check to avoid division by zero. start = ((row_num / num_staggers) % 1) * max_stitch_length projections = np.arange(start, line.length, max_stitch_length) points = np.array([line.interpolate(projection).coords[0] for projection in projections]) - if len(points) <= 2: + if len(points) < 2: return line stitched_line = shgeo.LineString(points) |
