diff options
author | jaseg <git@jaseg.de> | 2022-02-03 01:02:45 +0100 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2022-02-03 01:02:45 +0100 |
commit | ac66fd9d6b3561c1a0fb52ac2e196157bcf5f4fd (patch) | |
tree | 35af3d6f1c0e1519ccfe40363a022a6b8d1ab494 /gerbonara/apertures.py | |
parent | 18b9da86601ad95aaf7f0d3e02617a1970aaf574 (diff) | |
download | gerbonara-ac66fd9d6b3561c1a0fb52ac2e196157bcf5f4fd.tar.gz gerbonara-ac66fd9d6b3561c1a0fb52ac2e196157bcf5f4fd.tar.bz2 gerbonara-ac66fd9d6b3561c1a0fb52ac2e196157bcf5f4fd.zip |
More doc!
Diffstat (limited to 'gerbonara/apertures.py')
-rw-r--r-- | gerbonara/apertures.py | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gerbonara/apertures.py b/gerbonara/apertures.py index e22b702..d717d36 100644 --- a/gerbonara/apertures.py +++ b/gerbonara/apertures.py @@ -10,10 +10,9 @@ from . import graphic_primitives as gp def _flash_hole(self, x, y, unit=None, polarity_dark=True): if getattr(self, 'hole_rect_h', None) is not None: + w, h = self.unit.convert_to(unit, self.hole_dia), self.unit.convert_to(unit, self.hole_rect_h) return [*self._primitives(x, y, unit, polarity_dark), - gp.Rectangle((x, y), - (self.unit.convert_to(unit, self.hole_dia), self.unit.convert_to(unit, self.hole_rect_h)), - rotation=self.rotation, polarity_dark=(not polarity_dark))] + gp.Rectangle(x, y, w, h, rotation=self.rotation, polarity_dark=(not polarity_dark))] elif self.hole_dia is not None: return [*self._primitives(x, y, unit, polarity_dark), gp.Circle(x, y, self.unit.convert_to(unit, self.hole_dia/2), polarity_dark=(not polarity_dark))] @@ -312,7 +311,7 @@ class ObroundAperture(Aperture): rotation : float = 0 def _primitives(self, x, y, unit=None, polarity_dark=True): - return [ gp.Obround(x, y, self.unit.convert_to(unit, self.w), self.unit.convert_to(unit, self.h), + return [ gp.Line.from_obround(x, y, self.unit.convert_to(unit, self.w), self.unit.convert_to(unit, self.h), rotation=self.rotation, polarity_dark=polarity_dark) ] def __str__(self): @@ -370,7 +369,7 @@ class PolygonAperture(Aperture): self.n_vertices = int(self.n_vertices) def _primitives(self, x, y, unit=None, polarity_dark=True): - return [ gp.RegularPolygon(x, y, self.unit.convert_to(unit, self.diameter)/2, self.n_vertices, + return [ gp.ArcPoly.from_regular_polygon(x, y, self.unit.convert_to(unit, self.diameter)/2, self.n_vertices, rotation=self.rotation, polarity_dark=polarity_dark) ] def __str__(self): |