summaryrefslogtreecommitdiff
path: root/gerbonara/cad
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2023-07-21 19:15:21 +0200
committerjaseg <git@jaseg.de>2023-07-21 19:15:21 +0200
commit8cb91dabdb0cf995856f53ad201ffcbca7bcadff (patch)
tree83e192fbc0577061a955ae163c3a1de1c107cfa1 /gerbonara/cad
parent91b99a04523e7efb37dab0a5b9378c1c5a230b74 (diff)
downloadgerbonara-8cb91dabdb0cf995856f53ad201ffcbca7bcadff.tar.gz
gerbonara-8cb91dabdb0cf995856f53ad201ffcbca7bcadff.tar.bz2
gerbonara-8cb91dabdb0cf995856f53ad201ffcbca7bcadff.zip
WIP
Diffstat (limited to 'gerbonara/cad')
-rw-r--r--gerbonara/cad/kicad/symbols.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/gerbonara/cad/kicad/symbols.py b/gerbonara/cad/kicad/symbols.py
index 5810d97..b6ca90a 100644
--- a/gerbonara/cad/kicad/symbols.py
+++ b/gerbonara/cad/kicad/symbols.py
@@ -104,8 +104,6 @@ class Pin:
if self.hide:
return
- if self.name.value in ('PA3', 'QA'):
- print(self.name.value, self.at, p_rotation)
psx, psy = (-1 if p_mirror.x else 1), (-1 if p_mirror.y else 1)
x1, y1 = self.at.x, self.at.y
x2, y2 = self.at.x+self.length, self.at.y
@@ -113,7 +111,6 @@ class Pin:
style = {'stroke_width': 0.254, 'stroke': colorscheme.lines, 'stroke_linecap': 'round'}
yield Tag('path', **xform, **style, d=f'M 0 0 L {self.length:.3f} 0')
- return
eps = 1
for tag in {
@@ -142,17 +139,23 @@ class Pin:
}.get(self.style, []):
yield tag
+ rot = self.at.rotation + p_rotation
+ trot = self.at.rotation
+ h_align = 'left'
+
font = Newstroke.load()
if self.name.value != '~' and not self.unit.symbol.pin_names.hide:
yield font.render_svg(self.name.value,
size=self.name.effects.font.size.y or 1.27,
x0=self.length + 0.2,
y0=0,
- h_align='left',
+ h_align=h_align,
v_align='middle',
- rotation=self.at.rotation,
+ rotation=trot,
stroke=colorscheme.text,
transform=f'translate({self.at.x:.3f} {self.at.y:.3f})',
+ scale = (1, -1) if p_mirror.x or p_mirror.y else (1, -1),
+ mirror=(p_mirror.x, p_mirror.y),
)
if self.number.value != '~' and not self.unit.symbol.pin_numbers.hide:
@@ -162,7 +165,7 @@ class Pin:
y0=0.4,
h_align='right',
v_align='bottom',
- rotation=self.at.rotation,
+ rotation=trot,
stroke=colorscheme.text,
transform=f'translate({self.at.x:.3f} {self.at.y:.3f})',
)