diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2023-03-07 12:13:57 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-07 18:13:57 +0100 |
| commit | 74157dd1cb9adada35c2079c1e053e0b4b2dec19 (patch) | |
| tree | f2efb20ce8df1733805f86f67678380c533bf640 /lib/stitches | |
| parent | 9552291de5c7f1236542e9be3f1816e29701b7ed (diff) | |
meander: pick ending point far from starting point (#2095)
Diffstat (limited to 'lib/stitches')
| -rw-r--r-- | lib/stitches/meander_fill.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/stitches/meander_fill.py b/lib/stitches/meander_fill.py index 964a7a41..6043b4bc 100644 --- a/lib/stitches/meander_fill.py +++ b/lib/stitches/meander_fill.py @@ -66,7 +66,9 @@ def find_starting_and_ending_nodes(graph, shape, starting_point, ending_point): starting_point = Point(starting_point) if ending_point is None: - ending_point = starting_point + # pick a spot on the opposite side of the shape + projection = (shape.exterior.project(starting_point, normalized=True) + 0.5) % 1.0 + ending_point = shape.exterior.interpolate(projection, normalized=True) else: ending_point = Point(ending_point) |
