diff options
author | jaseg <git@jaseg.de> | 2023-04-22 17:16:20 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2023-04-22 17:16:20 +0200 |
commit | a93d118773818fbd47af4965d7b37e1b10bdf9b6 (patch) | |
tree | 528a06ac8154dfa70caa8714e7aa5ea62a51dd9f /gerbonara/graphic_objects.py | |
parent | 5ce88e4d1b06dcc846c94ec614fb00f64e85c125 (diff) | |
download | gerbonara-a93d118773818fbd47af4965d7b37e1b10bdf9b6.tar.gz gerbonara-a93d118773818fbd47af4965d7b37e1b10bdf9b6.tar.bz2 gerbonara-a93d118773818fbd47af4965d7b37e1b10bdf9b6.zip |
kicad unit tests WIP
Diffstat (limited to 'gerbonara/graphic_objects.py')
-rw-r--r-- | gerbonara/graphic_objects.py | 6 |
1 files changed, 3 insertions, 3 deletions
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): |