From a93d118773818fbd47af4965d7b37e1b10bdf9b6 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sat, 22 Apr 2023 17:16:20 +0200 Subject: kicad unit tests WIP --- gerbonara/graphic_objects.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gerbonara/graphic_objects.py') diff --git a/gerbonara/graphic_objects.py b/gerbonara/graphic_objects.py index 0d28045..bcf94ce 100644 --- a/gerbonara/graphic_objects.py +++ b/gerbonara/graphic_objects.py @@ -565,7 +565,7 @@ class Arc(GraphicObject): @classmethod def from_circle(kls, cx, cy, r, aperture, unit=MM): - return kls(cx-r, cy, cx-r, cy, r, 0, aperture=aperture, unit=MM) + return kls(cx-r, cy, cx-r, cy, r, 0, aperture=aperture, clockwise=True, unit=MM) def _offset(self, dx, dy): self.x1 += dx @@ -681,7 +681,7 @@ class Arc(GraphicObject): max_error = min(max_error, r*0.4588038998538031) elif max_error >= r: - return [Line(*self.p1, *self.p2, aperture=self.aperture, polarity_dark=self.polarity_dark)] + return [Line(*self.p1, *self.p2, aperture=self.aperture, polarity_dark=self.polarity_dark, unit=self.unit)] # see https://www.mathopenref.com/sagitta.html l = math.sqrt(r**2 - (r - max_error)**2) @@ -696,7 +696,7 @@ class Arc(GraphicObject): cx, cy = self.center points = [ rotate_point(self.x1, self.y1, i*angle, cx, cy) for i in range(num_segments + 1) ] - return [ Line(*p1, *p2, aperture=self.aperture, polarity_dark=self.polarity_dark) + return [ Line(*p1, *p2, aperture=self.aperture, polarity_dark=self.polarity_dark, unit=self.unit) for p1, p2 in zip(points[0::], points[1::]) ] def _rotate(self, rotation, cx=0, cy=0): -- cgit