From 6b686545f4b764453bec970ea94f1be14badc82e Mon Sep 17 00:00:00 2001 From: Marco Massarelli Date: Sun, 28 Jan 2024 19:03:22 +0000 Subject: [PATCH] Overhaul footprint (header, params, name) --- ergogen/config.yaml | 30 ++++++++++---------- ergogen/footprints/mounting_hole_npth.js | 36 ++++++++++++++++++++++++ ergogen/footprints/screw_hole.js | 14 --------- 3 files changed, 51 insertions(+), 29 deletions(-) create mode 100644 ergogen/footprints/mounting_hole_npth.js delete mode 100644 ergogen/footprints/screw_hole.js diff --git a/ergogen/config.yaml b/ergogen/config.yaml index bbbad00..8e41ed0 100644 --- a/ergogen/config.yaml +++ b/ergogen/config.yaml @@ -611,11 +611,11 @@ pcbs: outline: backplate footprints: m2_screws: - what: screw_hole + what: mounting_hole_npth where: /screw_pcb/ params: - size: screw_diameter - drill: screw_diameter + hole_size: screw_diameter + hole_drill: screw_diameter frontplate: outlines: @@ -623,11 +623,11 @@ pcbs: outline: frontplate footprints: m2_screws: - what: screw_hole + what: mounting_hole_npth where: /screw_pcb/ params: - size: screw_diameter - drill: screw_diameter + hole_size: screw_diameter + hole_drill: screw_diameter controller_overlay: outlines: @@ -635,11 +635,11 @@ pcbs: outline: controller_overlay footprints: m2_screws: - what: screw_hole + what: mounting_hole_npth where: /screw_mcu/ params: - size: screw_diameter - drill: screw_diameter + hole_size: screw_diameter + hole_drill: screw_diameter _corney_island_baseline: outlines: &basepcb_outlines @@ -651,17 +651,17 @@ pcbs: footprints: &basepcb_footprints m2_screws: - what: screw_hole + what: mounting_hole_npth where: /screw_mcu/ params: - size: screw_diameter - drill: screw_diameter + hole_size: screw_diameter + hole_drill: screw_diameter m2_spacers: - what: screw_hole + what: mounting_hole_npth where: /screw_pcb/ params: - size: spacer_diameter - drill: spacer_diameter + hole_size: spacer_diameter + hole_drill: spacer_diameter key_switches: what: *switch_footprint where: /key/ diff --git a/ergogen/footprints/mounting_hole_npth.js b/ergogen/footprints/mounting_hole_npth.js new file mode 100644 index 0000000..f9b6318 --- /dev/null +++ b/ergogen/footprints/mounting_hole_npth.js @@ -0,0 +1,36 @@ +// Copyright (c) 2023 Marco Massarelli +// +// SPDX-License-Identifier: MIT +// +// To view a copy of this license, visit https://opensource.org/license/mit/ +// +// Author: @ceoloide +// +// Description: +// A non-plated, mechanical through-hole to be used for screws, standoffs or +// other mounting options. Both the drill size and pad size can be independently +// defined. +// +// Params: +// side: default is F for Front +// the side on which to place the footprint and designator, either F or B +// hole_size: default is 2.2mm for M2 screws +// the size of the pad around the hole +// hole_drill: default is 2.2mm for M2 screws +// the size of the hole to drill + +module.exports = { + params: { + designator: 'MH', + side: 'F', + hole_size: '2.2', + hole_drill: '2.2', + }, + body: p => ` + (module "ceoloide/mounting_hole_npth" (layer ${p.side}.Cu) (tedit 5F1B9159) + ${p.at /* parametric position */} + (fp_text reference "${p.ref}" (at 0 2.55) (layer ${p.side}.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15)))) + (pad "" np_thru_hole circle (at 0 0) (size ${p.size} ${p.size}) (drill ${p.drill}) (layers *.Cu *.Mask)) + ) + ` +} \ No newline at end of file diff --git a/ergogen/footprints/screw_hole.js b/ergogen/footprints/screw_hole.js deleted file mode 100644 index b1529f0..0000000 --- a/ergogen/footprints/screw_hole.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = { - params: { - designator: 'H', // for Hole - size: '2.2', // Default to M2 - drill: '2.2' - }, - body: p => ` - (module "Screw_Hole" (layer F.Cu) (tedit 5F1B9159) - ${p.at /* parametric position */} - (fp_text reference "${p.ref}" (at 0 2.55) (layer F.SilkS) ${p.ref_hide} (effects (font (size 1 1) (thickness 0.15)))) - (pad "" np_thru_hole circle (at 0 0) (size ${p.size} ${p.size}) (drill ${p.drill}) (layers *.Cu *.Mask)) - ) - ` -} \ No newline at end of file