From 74157dd1cb9adada35c2079c1e053e0b4b2dec19 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Tue, 7 Mar 2023 12:13:57 -0500 Subject: meander: pick ending point far from starting point (#2095) --- lib/stitches/meander_fill.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/stitches/meander_fill.py') 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) -- cgit v1.2.3