diff options
author | jaseg <git@jaseg.de> | 2023-04-26 22:48:08 +0200 |
---|---|---|
committer | jaseg <git@jaseg.de> | 2023-04-26 22:48:08 +0200 |
commit | 549a33d386a19b976248f3a357135f3b9f579cdc (patch) | |
tree | 98e829917a00929db2182e6b2c31293e75df467b | |
parent | 8409fbb90835c61bd675dc0070ea38ac671540f8 (diff) | |
download | gerbonara-549a33d386a19b976248f3a357135f3b9f579cdc.tar.gz gerbonara-549a33d386a19b976248f3a357135f3b9f579cdc.tar.bz2 gerbonara-549a33d386a19b976248f3a357135f3b9f579cdc.zip |
Finish spiky proto layout by electroniceel
-rw-r--r-- | gerbonara/cad/protoboard.py | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/gerbonara/cad/protoboard.py b/gerbonara/cad/protoboard.py index 9c3fbd7..f08fb32 100644 --- a/gerbonara/cad/protoboard.py +++ b/gerbonara/cad/protoboard.py @@ -477,14 +477,34 @@ class SpikyProto(ObjectGroup): res = importlib.resources.files(package_data) self.fp_center = kfp.Footprint.load(res.joinpath('center-pad-spikes.kicad_mod').read_text(encoding='utf-8')) - self.objects.append(kfp.FootprintInstance(1.27, 1.27, self.fp_center, unit=MM)) + self.corner_pad = kfp.FootprintInstance(1.27, 1.27, self.fp_center, unit=MM) + + self.pad = kfp.Footprint.load(res.joinpath('tht-0.8.kicad_mod').read_text(encoding='utf-8')) + self.center_pad = kfp.FootprintInstance(0, 0, self.pad, unit=MM) self.fp_between = kfp.Footprint.load(res.joinpath('pad-between-spiked.kicad_mod').read_text(encoding='utf-8')) - self.objects.append(kfp.FootprintInstance(1.27, 0, self.fp_between, unit=MM)) - self.objects.append(kfp.FootprintInstance(0, 1.27, self.fp_between, rotation=math.pi/2, unit=MM)) + self.right_pad = kfp.FootprintInstance(1.27, 0, self.fp_between, unit=MM) + self.top_pad = kfp.FootprintInstance(0, 1.27, self.fp_between, rotation=math.pi/2, unit=MM) + + @property + def objects(self): + return [x for x in (self.center_pad, self.corner_pad, self.right_pad, self.top_pad) if x is not None] + + @objects.setter + def objects(self, value): + pass + + def inst(self, x, y, border_x, border_y): + inst = copy(self) + + if border_x: + inst.corner_pad = inst.right_pad = None + + if border_y: + inst.corner_pad = inst.top_pad = None + + return inst - self.pad = kfp.Footprint.load(res.joinpath('tht-0.8.kicad_mod').read_text(encoding='utf-8')) - self.objects.append(kfp.FootprintInstance(0, 0, self.pad, unit=MM)) def convert_to_mm(value, unit): unitl = unit.lower() |