From 36da1fd68bcfb44957d370584231545cee0b2e20 Mon Sep 17 00:00:00 2001 From: jaseg Date: Thu, 26 Oct 2023 23:53:23 +0200 Subject: Fix failing test cases --- gerbonara/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gerbonara/utils.py') diff --git a/gerbonara/utils.py b/gerbonara/utils.py index 0e6a085..6d8445d 100644 --- a/gerbonara/utils.py +++ b/gerbonara/utils.py @@ -286,9 +286,9 @@ def approximate_arc(cx, cy, x1, y1, x2, y2, clockwise, max_error=1e-2, clip_max_ l = math.sqrt(r**2 - (r - max_error)**2) angle_max = math.asin(l/r) - sweep_angle = sweep_angle(cx, cy, x1, y1, x2, y2, clockwise) - num_segments = math.ceil(sweep_angle / angle_max) - angle = sweep_angle / num_segments + alpha = sweep_angle(cx, cy, x1, y1, x2, y2, clockwise) + num_segments = math.ceil(alpha / angle_max) + angle = alpha / num_segments if not clockwise: angle = -angle -- cgit