aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2022-06-19 21:24:45 +0200
committerjaseg <git@jaseg.de>2022-06-19 21:24:45 +0200
commit5f33356f330465907cb9ec69fb4543c271f3bea4 (patch)
tree880bea839afce90d5344c41a65b47fc7bcb2ee30
parente3d8c3a063e2e1e10dd65453db6204d85c4294f8 (diff)
downloadgerbolyze-5f33356f330465907cb9ec69fb4543c271f3bea4.tar.gz
gerbolyze-5f33356f330465907cb9ec69fb4543c271f3bea4.tar.bz2
gerbolyze-5f33356f330465907cb9ec69fb4543c271f3bea4.zip
protoboard: finish hole support
-rw-r--r--gerbolyze/protoboard.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/gerbolyze/protoboard.py b/gerbolyze/protoboard.py
index f7603ad..622c0e7 100644
--- a/gerbolyze/protoboard.py
+++ b/gerbolyze/protoboard.py
@@ -135,6 +135,7 @@ class ProtoBoard:
self.mounting_holes = mounting_holes
def generate(self, w, h):
+ out = {l: [] for l in LAYERS}
svg_defs = []
clip = ''
@@ -145,7 +146,12 @@ class ProtoBoard:
svg_defs.append(f'<clipPath id="hole-clip"><path d="{clip_d}"/></clipPath>')
clip = 'clip-path="url(#hole-clip)"'
- out = {l: [] for l in LAYERS}
+ out['nonplated drill'].append([
+ f'<circle cx="{o}" cy="{o}" r="{d/2}"/>',
+ f'<circle cx="{w-o}" cy="{o}" r="{d/2}"/>',
+ f'<circle cx="{w-o}" cy="{h-o}" r="{d/2}"/>',
+ f'<circle cx="{o}" cy="{h-o}" r="{d/2}"/>' ])
+
for layer_dict in self.layout.generate(0, 0, w, h, self.defs, clip):
for l in LAYERS:
if l in layer_dict:
@@ -352,5 +358,5 @@ if __name__ == '__main__':
# print(line, '->', eval_defs(line))
# print()
# print('===== Proto board =====')
- b = ProtoBoard('tht = THTCircles()', 'tht@1in|(tht@2/tht@1)', mounting_holes=(3.2, 5.0, 5.0))
+ b = ProtoBoard('tht = THTCircles(); tht_small = THTCircles(pad_dia=1.0, drill=0.6, pitch=1.27)', 'tht@1in|(tht_small@2/tht@1)', mounting_holes=(3.2, 5.0, 5.0))
print(b.generate(80, 60))