From d7b725f3ba88d097a8ead7c7d445e37c84e88e64 Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Tue, 5 Mar 2024 20:41:06 +0100 Subject: [PATCH] PCB: Add mounting holes --- ergogen/config.yaml | 25 ++++++++++++++++++++++++- ergogen/footprints/mountinghole_m2.js | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 ergogen/footprints/mountinghole_m2.js diff --git a/ergogen/config.yaml b/ergogen/config.yaml index f446e87..1213b07 100644 --- a/ergogen/config.yaml +++ b/ergogen/config.yaml @@ -257,4 +257,27 @@ pcbs: from: GND to: RST -# TODO: Mounting holes? + # Mounting holes + mounting_hole_top_left: + what: mountinghole_m2 + where: + ref: pad_one_five + shift: [ -8, 15 ] + + mounting_hole_top_right: + what: mountinghole_m2 + where: + ref: pad_three_five + shift: [ 8, 15 ] + + mounting_hole_bottom_left: + what: mountinghole_m2 + where: + ref: pad_one_one + shift: [ -10.25, 0 ] + + mounting_hole_bottom_right: + what: mountinghole_m2 + where: + ref: pad_five_one + shift: [ 10, -6 ] diff --git a/ergogen/footprints/mountinghole_m2.js b/ergogen/footprints/mountinghole_m2.js new file mode 100644 index 0000000..b11ed32 --- /dev/null +++ b/ergogen/footprints/mountinghole_m2.js @@ -0,0 +1,24 @@ +// MountingHole_2.2mm_M2 +// Source: https://kicad.github.io/footprints/MountingHole +module.exports = { + nets: { + net: undefined + }, + params: { + class: 'HOLE', + }, + body: p => ` + (module MountingHole_2.2mm_M2 (layer F.Cu) (tedit 56D1B4CB) + ${p.at /* parametric position */} + + (fp_text reference "${p.ref}" (at 0 -3.2) (layer F.SilkS) ${p.ref_hide} + (effects (font (size 1 1) (thickness 0.15))) + ) + + (fp_circle (center 0 0) (end 2.2 0) (layer Cmts.User) (width 0.15)) + + (fp_circle (center 0 0) (end 2.45 0) (layer F.CrtYd) (width 0.05)) + (pad 1 np_thru_hole circle (at 0 0) (size 2.2 2.2) (drill 2.2) (layers *.Cu *.Mask)) + ) + ` +}