Overhaul footprint (header, params, name)

This commit is contained in:
Marco Massarelli 2024-01-28 19:03:22 +00:00
parent c90e9d77be
commit 6b686545f4
3 changed files with 51 additions and 29 deletions

View File

@ -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/

View File

@ -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))
)
`
}

View File

@ -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))
)
`
}