summaryrefslogtreecommitdiff
path: root/gerbonara/cad/primitives.py
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2024-07-07 00:32:17 +0200
committerjaseg <git@jaseg.de>2024-07-07 00:32:17 +0200
commit552f30c15dc1fc11b418d08e3f598d170bbea5c4 (patch)
tree728766025f20bf7c646851c0db3f23177db1994f /gerbonara/cad/primitives.py
parentf721692bf348489ac8444e3ed1560e4f0793b213 (diff)
downloadgerbonara-552f30c15dc1fc11b418d08e3f598d170bbea5c4.tar.gz
gerbonara-552f30c15dc1fc11b418d08e3f598d170bbea5c4.tar.bz2
gerbonara-552f30c15dc1fc11b418d08e3f598d170bbea5c4.zip
Protoboard: All layouts except for spiky proto work
Diffstat (limited to 'gerbonara/cad/primitives.py')
-rw-r--r--gerbonara/cad/primitives.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/gerbonara/cad/primitives.py b/gerbonara/cad/primitives.py
index 08fb1e5..82c06e1 100644
--- a/gerbonara/cad/primitives.py
+++ b/gerbonara/cad/primitives.py
@@ -368,11 +368,11 @@ class Text(Positioned):
x0 = -approx_w
if self.v_align == 'top':
- y0 = -approx_h
+ y0 = 0
elif self.v_align == 'middle':
y0 = -approx_h/2
elif self.v_align == 'bottom':
- y0 = 0
+ y0 = -approx_h
return (self.x+x0, self.y+y0), (self.x+x0+approx_w, self.y+y0+approx_h)
@@ -385,6 +385,7 @@ class PadStackAperture:
offset_x: float = 0 # in PadStack units
offset_y: float = 0
rotation: float = 0
+ invert: bool = False
@dataclass(frozen=True, slots=True)
@@ -399,7 +400,7 @@ class PadStack:
def flashes(self, x, y, rotation: float = 0, flip: bool = False):
for ap in self.apertures:
aperture = ap.aperture.rotated(ap.rotation + rotation)
- fl = Flash(ap.offset_x, ap.offset_y, aperture, unit=self.unit)
+ fl = Flash(ap.offset_x, ap.offset_y, aperture, polarity_dark=not ap.invert, unit=self.unit)
fl.rotate(rotation)
fl.offset(x, y)
side = ap.side