summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-04-29 13:52:04 +0200
committerjaseg <git@jaseg.de>2023-04-30 11:06:47 +0200
commitaf3458b1e22f92f51606cff8f771d03551af4cc0 (patch)
tree8a41abcc78aa8d358663d37a73b3044b83991a46
parent73a48f1dcb8bbe25221a5df952a36aec301b9f37 (diff)
downloadgerbonara-af3458b1e22f92f51606cff8f771d03551af4cc0.tar.gz
gerbonara-af3458b1e22f92f51606cff8f771d03551af4cc0.tar.bz2
gerbonara-af3458b1e22f92f51606cff8f771d03551af4cc0.zip
Fix failing kicad tests
-rw-r--r--gerbonara/apertures.py10
-rw-r--r--gerbonara/cad/kicad/footprints.py4
-rw-r--r--gerbonara/utils.py2
3 files changed, 8 insertions, 8 deletions
diff --git a/gerbonara/apertures.py b/gerbonara/apertures.py
index d901765..4582b76 100644
--- a/gerbonara/apertures.py
+++ b/gerbonara/apertures.py
@@ -254,11 +254,11 @@ class RectangleAperture(Aperture):
def to_macro(self, rotation=0):
return ApertureMacroInstance(GenericMacros.rect,
- [MM(self.w, self.unit),
+ (MM(self.w, self.unit),
MM(self.h, self.unit),
MM(self.hole_dia, self.unit) or 0,
0,
- rotation])
+ rotation))
def _params(self, unit=None):
return _strip_right(
@@ -321,11 +321,11 @@ class ObroundAperture(Aperture):
inst = replace(self, w=self.h, h=self.w, hole_dia=self.hole_dia)
return ApertureMacroInstance(GenericMacros.obround,
- [MM(inst.w, self.unit),
+ (MM(inst.w, self.unit),
MM(inst.h, self.unit),
MM(inst.hole_dia, self.unit) or 0,
0,
- inst.rotation + rotation])
+ rotation))
def _params(self, unit=None):
return _strip_right(
@@ -369,7 +369,7 @@ class PolygonAperture(Aperture):
@lru_cache()
def rotated(self, angle=0):
if angle != 0:
- return replace(self, rotatio=self.rotation + angle)
+ return replace(self, rotation=self.rotation + angle)
else:
return self
diff --git a/gerbonara/cad/kicad/footprints.py b/gerbonara/cad/kicad/footprints.py
index d7ccc9f..ece7b53 100644
--- a/gerbonara/cad/kicad/footprints.py
+++ b/gerbonara/cad/kicad/footprints.py
@@ -404,7 +404,7 @@ class Pad:
yield go.Flash(self.at.x+ox, self.at.y+oy, aperture, unit=MM)
def aperture(self, margin=None):
- rotation = -math.radians(self.at.rotation)
+ rotation = math.radians(self.at.rotation)
margin = margin or 0
if self.shape == Atom.circle:
@@ -437,7 +437,7 @@ class Pad:
if dx != 0:
x, y = y, x
dy = dx
- rotation -= math.pi/2
+ rotation += math.pi/2
if margin <= 0:
# Note: KiCad already uses MM units, so no conversion needed here.
diff --git a/gerbonara/utils.py b/gerbonara/utils.py
index 12ac787..2bda581 100644
--- a/gerbonara/utils.py
+++ b/gerbonara/utils.py
@@ -84,7 +84,7 @@ class LengthUnit:
if unit == self or unit is None or value is None:
return value
- return value * unit.factor / self.factor
+ return value * unit.this_in_mm / self.this_in_mm
def convert_to(self, unit, value):
""" :py:meth:`.LengthUnit.convert_from` but in reverse. """