From 34fae0a7c2cf894117eee0b25e32726a492d25a8 Mon Sep 17 00:00:00 2001 From: jaseg Date: Mon, 3 Jul 2023 22:59:47 +0200 Subject: Fix handling of circles on outline layer --- gerbonara/layers.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'gerbonara/layers.py') diff --git a/gerbonara/layers.py b/gerbonara/layers.py index e8ce1a3..daed004 100644 --- a/gerbonara/layers.py +++ b/gerbonara/layers.py @@ -1140,6 +1140,12 @@ class LayerStack: joins = {} for cur in lines: + # Special case: An arc may describe a complete circle, in which case we have to return it as-is since it + # is the only primitive that can join itself. + if isinstance(cur, gp.Arc) and cur.is_circle: + yield [cur] + continue + for (i, x, y) in [(0, cur.x1, cur.y1), (1, cur.x2, cur.y2)]: x_left = bisect.bisect_left (by_x, x, key=lambda elem: elem[0] + tol) x_right = bisect.bisect_right(by_x, x, key=lambda elem: elem[0] - tol) -- cgit