From 5f33356f330465907cb9ec69fb4543c271f3bea4 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 19 Jun 2022 21:24:45 +0200 Subject: protoboard: finish hole support --- gerbolyze/protoboard.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'gerbolyze') 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'') clip = 'clip-path="url(#hole-clip)"' - out = {l: [] for l in LAYERS} + out['nonplated drill'].append([ + f'', + f'', + f'', + f'' ]) + 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)) -- cgit