From 13a40d750ebcf2b4ad3143737873d3a8fe3c1aa7 Mon Sep 17 00:00:00 2001 From: Tony Grosinger Date: Fri, 7 Apr 2023 14:59:50 -0700 Subject: [PATCH] Footprints I used for my keyboards See https://github.com/tgrosinger/keyboards --- src/footprints/battery_pads.js | 95 ++++++++++++++++++++ src/footprints/choc_with_diode.js | 121 ++++++++++++++++++++++++++ src/footprints/chocmini_with_diode.js | 109 +++++++++++++++++++++++ src/footprints/diode.js | 43 ++++++--- src/footprints/index.js | 7 +- src/footprints/m2_mounting_hole.js | 16 ++++ src/footprints/two_lead_button.js | 19 ++++ 7 files changed, 398 insertions(+), 12 deletions(-) create mode 100644 src/footprints/battery_pads.js create mode 100644 src/footprints/choc_with_diode.js create mode 100644 src/footprints/chocmini_with_diode.js create mode 100644 src/footprints/m2_mounting_hole.js create mode 100644 src/footprints/two_lead_button.js diff --git a/src/footprints/battery_pads.js b/src/footprints/battery_pads.js new file mode 100644 index 0000000..127586c --- /dev/null +++ b/src/footprints/battery_pads.js @@ -0,0 +1,95 @@ +module.exports = { + nets: { + neg: undefined, + pos: undefined, + }, + body: p => ` + (module BatteryPads + (layer "F.Cu") + + ${p.at /* parametric position */} + + ${'' /* TODO: Does not yet support rotation */} + + + (fp_text reference "BT1" (at 0 0.5) (layer "F.SilkS") hide (effects (font (size 1 1) (thickness 0.15)))) + (fp_text value "Battery_Cell" (at 0 -0.5) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15)))) + (fp_text user "Battery_Cell" (at 0 -0.5) (layer "B.Fab") (effects (font (size 1 1) (thickness 0.15)) (justify mirror))) + (fp_text user "BT01" (at 0 0.5) (layer "B.SilkS") hide (effects (font (size 1 1) (thickness 0.15)) (justify mirror))) + (fp_text user "Battery" (at 3.175 0.79375 90) (layer "F.SilkS") hide (effects (font (size 0.8 0.8) (thickness 0.1)))) + (fp_text user "Battery" (at 3.175 0.79375 90) (layer "B.SilkS") hide (effects (font (size 0.8 0.8) (thickness 0.1)) (justify mirror))) + (fp_text user "(+)" (at -1.1 -2.286) (layer "F.SilkS") (effects (font (size 0.8 0.8) (thickness 0.1)))) + (fp_text user "(+)" (at -1.1 -2.286) (layer "B.SilkS") (effects (font (size 0.8 0.8) (thickness 0.1)) (justify mirror))) + (fp_text user "(-)" (at 1.1 -2.286) (layer "F.SilkS") (effects (font (size 0.8 0.8) (thickness 0.1)))) + (fp_text user "(-)" (at 1.1 -2.286) (layer "B.SilkS") (effects (font (size 0.8 0.8) (thickness 0.1)) (justify mirror))) + + (fp_poly (pts + (xy 0.4 -1) + (xy 0.4 1) + (xy 1.8 1) + (xy 1.8 -1) + ) (layer "B.Mask") (width 0.1) (fill solid)) + (fp_poly (pts + (xy -1.8 -1) + (xy -1.8 1) + (xy -0.4 1) + (xy -0.4 -1) + ) (layer "B.Mask") (width 0.1) (fill solid)) + (fp_poly (pts + (xy -0.401442 -1) + (xy -0.401442 1) + (xy -1.801442 1) + (xy -1.801442 -1) + ) (layer "F.Mask") (width 0.1) (fill solid)) + (fp_poly (pts + (xy 1.8 -1) + (xy 1.8 1) + (xy 0.4 1) + (xy 0.4 -1) + ) (layer "F.Mask") (width 0.1) (fill solid)) + + (pad "1" thru_hole circle (at -1.1004 -1.3416) (size 0.4572 0.4572) (drill 0.3048) (layers *.Cu) ${p.net.pos.str}) + (pad "1" smd custom (at -1.1 0 180) (size 1.5 2.1) (layers "F.Cu") + (options (clearance outline) (anchor rect)) + (primitives + (gr_poly (pts + (xy 0.179 1.3352) + (xy -0.1766 1.3352) + (xy -0.1766 0.762) + (xy 0.179 0.762) + ) (width 0.1) (fill yes)) + )) + (pad "1" smd custom (at -1.1 0) (size 1.5 2.1) (layers "B.Cu") + (options (clearance outline) (anchor rect)) + (primitives + (gr_poly (pts + (xy 0.176556 -0.7618) + (xy -0.179044 -0.7618) + (xy -0.179044 -1.335) + (xy 0.176556 -1.335) + ) (width 0.1) (fill yes)) + )) + (pad "2" thru_hole circle (at 1.1 -1.3416) (size 0.4572 0.4572) (drill 0.3048) (layers *.Cu) ${p.net.neg.str}) + (pad "2" smd custom (at 1.1 0 180) (size 1.5 2.1) (layers "F.Cu") + (options (clearance outline) (anchor rect)) + (primitives + (gr_poly (pts + (xy 0.1786 1.3352) + (xy -0.177 1.3352) + (xy -0.177 0.762) + (xy 0.1786 0.762) + ) (width 0.1) (fill yes)) + )) + (pad "2" smd custom (at 1.1 0) (size 1.5 2.1) (layers "B.Cu") + (options (clearance outline) (anchor rect)) + (primitives + (gr_poly (pts + (xy 0.1766 -0.7618) + (xy -0.179 -0.7618) + (xy -0.179 -1.335) + (xy 0.1766 -1.335) + ) (width 0.1) (fill yes)) + )) + ) + ` +} diff --git a/src/footprints/choc_with_diode.js b/src/footprints/choc_with_diode.js new file mode 100644 index 0000000..6252e1e --- /dev/null +++ b/src/footprints/choc_with_diode.js @@ -0,0 +1,121 @@ +// Kailh Choc PG1350 +// Nets +// from: corresponds to pin 1 +// to: corresponds to pin 2 +// Params +// hotswap: default is false +// if true, will include holes and pads for Kailh choc hotswap sockets +// reverse: default is false +// if true, will flip the footprint such that the pcb can be reversible +// keycaps: default is false +// if true, will add choc sized keycap box around the footprint +// +// note: hotswap and reverse can be used simultaneously + +module.exports = { + nets: { + from: undefined, + to: undefined + }, + params: { + class: 'S', + hotswap: false, + reverse: false, + keycaps: false + }, + body: p => { + const standard = ` + (module PG1350 (layer F.Cu) (tedit 5DD50112) + ${p.at /* parametric position */} + + ${'' /* footprint reference */} + (fp_text reference "${p.ref}" (at 0 0) (layer F.SilkS) ${p.ref_hide} (effects (font (size 1.27 1.27) (thickness 0.15)))) + (fp_text value "" (at 0 0) (layer F.SilkS) hide (effects (font (size 1.27 1.27) (thickness 0.15)))) + + ${''/* diode box marker */} + (fp_line (start 2.868 3.326) (end 2.868 5.476) (layer "Dwgs.User") (width 0.15)) + (fp_line (start -2.732 5.476) (end 2.868 5.476) (layer "Dwgs.User") (width 0.15)) + (fp_line (start 2.868 3.326) (end -2.732 3.326) (layer "Dwgs.User") (width 0.15)) + (fp_line (start -2.732 3.326) (end -2.732 5.476) (layer "Dwgs.User") (width 0.15)) + + ${''/* diode direction marker */} + (fp_line (start -0.282 4.426) (end 0.318 4.026) (layer "F.SilkS") (width 0.1)) + (fp_line (start 0.318 4.826) (end -0.282 4.426) (layer "F.SilkS") (width 0.1)) + (fp_line (start -0.282 4.426) (end -0.282 3.876) (layer "F.SilkS") (width 0.1)) + (fp_line (start -0.282 4.426) (end -0.282 4.976) (layer "F.SilkS") (width 0.1)) + (fp_line (start -0.682 4.426) (end -0.282 4.426) (layer "F.SilkS") (width 0.1)) + (fp_line (start 0.318 4.426) (end 0.818 4.426) (layer "F.SilkS") (width 0.1)) + (fp_line (start 0.318 4.026) (end 0.318 4.826) (layer "F.SilkS") (width 0.1)) + + ${''/* diode pads */} + (pad "" smd rect (at 1.776 4.401 ${ p.rot }) (size 1.1 1.9) (layers "B.Cu" "B.Paste" "B.Mask")) + (pad 2 smd rect (at -1.524 4.401 ${ p.rot }) (size 1.1 1.9) (layers "B.Cu" "B.Paste" "B.Mask") ${p.net.to.str}) + + ${''/* corner marks */} + (fp_line (start -7 -6) (end -7 -7) (layer Dwgs.User) (width 0.15)) + (fp_line (start -7 7) (end -6 7) (layer Dwgs.User) (width 0.15)) + (fp_line (start -6 -7) (end -7 -7) (layer Dwgs.User) (width 0.15)) + (fp_line (start -7 7) (end -7 6) (layer Dwgs.User) (width 0.15)) + (fp_line (start 7 6) (end 7 7) (layer Dwgs.User) (width 0.15)) + (fp_line (start 7 -7) (end 6 -7) (layer Dwgs.User) (width 0.15)) + (fp_line (start 6 7) (end 7 7) (layer Dwgs.User) (width 0.15)) + (fp_line (start 7 -7) (end 7 -6) (layer Dwgs.User) (width 0.15)) + + ${''/* middle shaft */} + (pad "" np_thru_hole circle (at 0 0) (size 3.429 3.429) (drill 3.429) (layers *.Cu *.Mask)) + + ${''/* stabilizers */} + (pad "" np_thru_hole circle (at 5.5 0) (size 1.7018 1.7018) (drill 1.7018) (layers *.Cu *.Mask)) + (pad "" np_thru_hole circle (at -5.5 0) (size 1.7018 1.7018) (drill 1.7018) (layers *.Cu *.Mask)) + + ` + const keycap = ` + ${'' /* keycap marks */} + (fp_line (start -9 -8.5) (end 9 -8.5) (layer Dwgs.User) (width 0.15)) + (fp_line (start 9 -8.5) (end 9 8.5) (layer Dwgs.User) (width 0.15)) + (fp_line (start 9 8.5) (end -9 8.5) (layer Dwgs.User) (width 0.15)) + (fp_line (start -9 8.5) (end -9 -8.5) (layer Dwgs.User) (width 0.15)) + ` + function pins(def_neg, def_pos, def_side) { + if(p.param.hotswap) { + return ` + ${'' /* holes */} + (pad "" np_thru_hole circle (at ${def_pos}5 -3.75) (size 3 3) (drill 3) (layers *.Cu *.Mask)) + (pad "" np_thru_hole circle (at 0 -5.95) (size 3 3) (drill 3) (layers *.Cu *.Mask)) + + ${'' /* net pads (other pad is with diode) */} + (pad 1 smd rect (at ${def_neg}3.275 -5.95 ${p.rot}) (size 2.6 2.6) (layers ${def_side}.Cu ${def_side}.Paste ${def_side}.Mask) ${p.net.from.str}) + + ${''/* right hotswap pad and trace to diode */} + (pad "" smd custom (at 8.275 -3.75 ${ p.rot }) (size 2.6 2.6) (layers ${def_side}.Cu ${def_side}.Paste ${def_side}.Mask) + (clearance 0.2) + (options (clearance outline) (anchor rect)) + (primitives + (gr_line (start -0.5 1) (end -0.5 4.6) (width 0.2)) + (gr_line (start -3.3284 7.4284) (end -6.5 7.4284) (width 0.2)) + (gr_line (start -0.499981 4.599974) (end -3.328408 7.428401) (width 0.2)) + )) + ` + } else { + return ` + ${''/* pins (other pad is with diode) */} + (pad 1 thru_hole circle (at ${def_pos}5 -3.8) (size 2.032 2.032) (drill 1.27) (layers *.Cu *.Mask) ${p.net.from.str}) + ` + } + } + if(p.param.reverse) { + return ` + ${standard} + ${p.param.keycaps ? keycap : ''} + ${pins('-', '', 'B')} + ${pins('', '-', 'F')}) + ` + } else { + return ` + ${standard} + ${p.param.keycaps ? keycap : ''} + ${pins('-', '', 'B')}) + ` + } + } +} \ No newline at end of file diff --git a/src/footprints/chocmini_with_diode.js b/src/footprints/chocmini_with_diode.js new file mode 100644 index 0000000..4f2b9d7 --- /dev/null +++ b/src/footprints/chocmini_with_diode.js @@ -0,0 +1,109 @@ +// Kailh Choc PG1232 +// Nets +// from: corresponds to pin 1 +// to: corresponds to pin 2 +// Params +// reverse: default is false +// if true, will flip the footprint such that the pcb can be reversible +// keycaps: default is false +// if true, will add choc sized keycap box around the footprint + +module.exports = { + nets: { + from: undefined, + to: undefined + }, + params: { + class: 'S', + side: 'F', + keycaps: false + }, + body: p => { + const standard = ` + (module lib:Kailh_PG1232 (layer F.Cu) (tedit 5E1ADAC2) + ${p.at /* parametric position */} + + ${'' /* footprint reference */} + (fp_text reference "${p.ref}" (at 0 0) (layer F.SilkS) ${p.ref_hide} (effects (font (size 1.27 1.27) (thickness 0.15)))) + (fp_text value Kailh_PG1232 (at 0 -7.3) (layer F.Fab) (effects (font (size 1 1) (thickness 0.15)))) + + ${'' /* corner marks */} + (fp_line (start -7.25 -6.75) (end -6.25 -6.75) (layer Dwgs.User) (width 0.15)) + (fp_line (start -7.25 -6.75) (end -7.25 -5.75) (layer Dwgs.User) (width 0.15)) + + (fp_line (start -7.25 6.75) (end -6.25 6.75) (layer Dwgs.User) (width 0.15)) + (fp_line (start -7.25 6.75) (end -7.25 5.75) (layer Dwgs.User) (width 0.15)) + + (fp_line (start 7.25 -6.75) (end 6.25 -6.75) (layer Dwgs.User) (width 0.15)) + (fp_line (start 7.25 -6.75) (end 7.25 -5.75) (layer Dwgs.User) (width 0.15)) + + (fp_line (start 7.25 6.75) (end 6.25 6.75) (layer Dwgs.User) (width 0.15)) + (fp_line (start 7.25 6.75) (end 7.25 5.75) (layer Dwgs.User) (width 0.15)) + + ${''/* diode box marker */} + (fp_line (start 2.8 -5.35) (end -2.8 -5.35) (layer Dwgs.User) (width 0.15)) + (fp_line (start -2.8 -3.2) (end 2.8 -3.2) (layer Dwgs.User) (width 0.15)) + (fp_line (start 2.8 -3.2) (end 2.8 -5.35) (layer Dwgs.User) (width 0.15)) + (fp_line (start -2.8 -3.2) (end -2.8 -5.35) (layer Dwgs.User) (width 0.15)) + + ${''/* diode direction marker */} + (fp_line (start 0.35 -4.3) (end 0.35 -3.75) (layer "F.SilkS") (width 0.1)) + (fp_line (start -0.25 -3.9) (end -0.25 -4.7) (layer "F.SilkS") (width 0.1)) + (fp_line (start -0.25 -4.3) (end -0.75 -4.3) (layer "F.SilkS") (width 0.1)) + (fp_line (start 0.35 -4.3) (end 0.35 -4.85) (layer "F.SilkS") (width 0.1)) + (fp_line (start 0.75 -4.3) (end 0.35 -4.3) (layer "F.SilkS") (width 0.1)) + (fp_line (start 0.35 -4.3) (end -0.25 -3.9) (layer "F.SilkS") (width 0.1)) + (fp_line (start -0.25 -4.7) (end 0.35 -4.3) (layer "F.SilkS") (width 0.1)) + + + ${''/* middle shaft */} + (fp_line (start 2.25 2.6) (end 5.8 2.6) (layer Edge.Cuts) (width 0.12)) + (fp_line (start -2.25 2.6) (end -5.8 2.6) (layer Edge.Cuts) (width 0.12)) + (fp_line (start 2.25 3.6) (end 2.25 2.6) (layer Edge.Cuts) (width 0.12)) + (fp_line (start -2.25 3.6) (end 2.25 3.6) (layer Edge.Cuts) (width 0.12)) + (fp_line (start -2.25 2.6) (end -2.25 3.6) (layer Edge.Cuts) (width 0.12)) + (fp_line (start -5.8 2.6) (end -5.8 -2.95) (layer Edge.Cuts) (width 0.12)) + (fp_line (start 5.8 -2.95) (end 5.8 2.6) (layer Edge.Cuts) (width 0.12)) + (fp_line (start -5.8 -2.95) (end 5.8 -2.95) (layer Edge.Cuts) (width 0.12)) + + ${''/* stabilizers */} + (pad 3 thru_hole circle (at 5.3 -4.75) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask) (clearance 0.2)) + (pad 4 thru_hole circle (at -5.3 -4.75) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask) (clearance 0.2)) + + ${''/* bottom-left switch pin */} + (pad 1 thru_hole circle (at -4.58 5.1) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask) ${p.net.from.str} (clearance 0.2)) + + ${''/* bottom-right switch pin and trace */} + (pad "" smd custom (at 2 5.4 ${ p.rot }) (size 1.6 1.6) (layers "F.Cu") + (clearance 0.2) + (options (clearance outline) (anchor circle)) + (primitives + (gr_line (start 0 0) (end -4 0) (width 0.13)) + (gr_line (start -4 0) (end -6 -2) (width 0.13)) + (gr_line (start -6 -2) (end -8 -2) (width 0.13)) + (gr_line (start -8.5 -2.5) (end -8.5 -8.35) (width 0.13)) + (gr_line (start -8 -8.85) (end -3.65 -8.85) (width 0.13)) + (gr_line (start -8.5 -8.35) (end -8 -8.85) (width 0.13) (fill yes)) + (gr_line (start -8.5 -2.5) (end -8 -2) (width 0.13) (fill yes)) + )) + (pad "" thru_hole circle (at 2 5.4 22) (size 1.6 1.6) (drill 1.1) (layers *.Cu *.Mask) (clearance 0.2)) + + ${''/* diode pads */} + (pad "" smd rect (at -1.65 -4.3 ${ p.rot }) (size 1.1 1.9) (layers "F.Cu" "F.Paste" "F.Mask")) + (pad "2" smd rect (at 1.65 -4.3 ${ p.rot }) (size 1.1 1.9) (layers "F.Cu" "F.Paste" "F.Mask") ${p.net.to.str}) + ` + const keycap = ` + ${'' /* keycap marks */} + (fp_line (start -9 -8.5) (end 9 -8.5) (layer Dwgs.User) (width 0.15)) + (fp_line (start 9 -8.5) (end 9 8.5) (layer Dwgs.User) (width 0.15)) + (fp_line (start 9 8.5) (end -9 8.5) (layer Dwgs.User) (width 0.15)) + (fp_line (start -9 8.5) (end -9 -8.5) (layer Dwgs.User) (width 0.15)) + ` + + return ` + ${standard} + ${p.param.keycaps ? keycap : ''} + ) + ` + } + } \ No newline at end of file diff --git a/src/footprints/diode.js b/src/footprints/diode.js index 741b747..00e1528 100644 --- a/src/footprints/diode.js +++ b/src/footprints/diode.js @@ -4,6 +4,11 @@ module.exports = { from: undefined, to: undefined }, + params: { + class: 'D', + through_hole: true, + via_in_pad: false + }, body: p => ` (module ComboDiode (layer F.Cu) (tedit 5B24D78E) @@ -30,17 +35,33 @@ module.exports = { (fp_line (start -0.35 0) (end -0.35 0.55) (layer B.SilkS) (width 0.1)) (fp_line (start -0.35 0) (end -0.35 -0.55) (layer B.SilkS) (width 0.1)) (fp_line (start -0.75 0) (end -0.35 0) (layer B.SilkS) (width 0.1)) - - ${''/* SMD pads on both sides */} - (pad 1 smd rect (at -1.65 0 ${p.rot}) (size 0.9 1.2) (layers F.Cu F.Paste F.Mask) ${p.to.str}) - (pad 2 smd rect (at 1.65 0 ${p.rot}) (size 0.9 1.2) (layers B.Cu B.Paste B.Mask) ${p.from.str}) - (pad 1 smd rect (at -1.65 0 ${p.rot}) (size 0.9 1.2) (layers B.Cu B.Paste B.Mask) ${p.to.str}) - (pad 2 smd rect (at 1.65 0 ${p.rot}) (size 0.9 1.2) (layers F.Cu F.Paste F.Mask) ${p.from.str}) + + ${ p.param.via_in_pad ? + ` + ${''/* Vias in SMD pads */} + (pad 1 thru_hole rect (at -1.65 0 ${ p.rot }) (size 0.9 1.2) (drill 0.3) (layers *.Cu *.Mask) (zone_connect 2) ${ p.net.to.str }) + (pad 2 thru_hole rect (at 1.65 0 ${ p.rot }) (size 0.9 1.2) (drill 0.3) (layers *.Cu *.Mask) (zone_connect 2) ${ p.net.from.str }) + ` + : + ` + ${ ''/* SMD pads on both sides */ } + (pad 1 smd rect (at -1.65 0 ${ p.rot }) (size 0.9 1.2) (layers F.Cu F.Paste F.Mask) ${ p.net.to.str }) + (pad 2 smd rect (at 1.65 0 ${ p.rot }) (size 0.9 1.2) (layers B.Cu B.Paste B.Mask) ${ p.net.from.str }) + (pad 1 smd rect (at -1.65 0 ${ p.rot }) (size 0.9 1.2) (layers B.Cu B.Paste B.Mask) ${ p.net.to.str }) + (pad 2 smd rect (at 1.65 0 ${ p.rot }) (size 0.9 1.2) (layers F.Cu F.Paste F.Mask) ${ p.net.from.str }) + ` + } - ${''/* THT terminals */} - (pad 1 thru_hole rect (at -3.81 0 ${p.rot}) (size 1.778 1.778) (drill 0.9906) (layers *.Cu *.Mask) ${p.to.str}) - (pad 2 thru_hole circle (at 3.81 0 ${p.rot}) (size 1.905 1.905) (drill 0.9906) (layers *.Cu *.Mask) ${p.from.str}) + ${ p.param.through_hole === false ? + '' + : + ` + ${''/* THT terminals */} + (pad 1 thru_hole circle (at 3.81 0 ${ p.rot }) (size 1.905 1.905) (drill 0.9906) (layers *.Cu *.Mask) ${ p.net.from.str }) + (pad 2 thru_hole rect (at -3.81 0 ${ p.rot }) (size 1.778 1.778) (drill 0.9906) (layers *.Cu *.Mask) ${ p.net.to.str }) + ` + } + ) - ` -} \ No newline at end of file +} diff --git a/src/footprints/index.js b/src/footprints/index.js index 6e63fbf..71f78f1 100644 --- a/src/footprints/index.js +++ b/src/footprints/index.js @@ -1,11 +1,15 @@ module.exports = { alps: require('./alps'), + battery_pads: require('./battery_pads.js'), button: require('./button'), choc: require('./choc'), + choc_with_diode: require('./choc_with_diode'), chocmini: require('./chocmini'), + chocmini_with_diode: require('./chocmini_with_diode'), diode: require('./diode'), jstph: require('./jstph'), jumper: require('./jumper'), + m2_mounting_hole: require('./m2_mounting_hole'), mx: require('./mx'), oled: require('./oled'), omron: require('./omron'), @@ -16,5 +20,6 @@ module.exports = { scrollwheel: require('./scrollwheel'), slider: require('./slider'), trrs: require('./trrs'), + two_lead_button: require('./two_lead_button'), via: require('./via'), -} \ No newline at end of file +} diff --git a/src/footprints/m2_mounting_hole.js b/src/footprints/m2_mounting_hole.js new file mode 100644 index 0000000..6b14502 --- /dev/null +++ b/src/footprints/m2_mounting_hole.js @@ -0,0 +1,16 @@ +module.exports = { + body: p => ` + (module M2MountingHole + (layer "F.Cu") + + ${p.at /* parametric position */} + + (fp_text reference "HOLE1" (at 0 -3.2 22) (layer "F.SilkS") hide + (effects (font (size 1 1) (thickness 0.15)))) + (fp_text value "Val**" (at 0 0) (layer "F.SilkS") hide + (effects (font (size 1.27 1.27) (thickness 0.15)))) + (fp_circle (center 0 0) (end 2 0) (layer "F.CrtYd") (width 0.05) (fill none)) + (pad "1" thru_hole circle (at 0 0 22) (size 3.6 3.6) (drill 2.2) (layers *.Cu *.Mask)) + ) + ` +} diff --git a/src/footprints/two_lead_button.js b/src/footprints/two_lead_button.js new file mode 100644 index 0000000..a4232a0 --- /dev/null +++ b/src/footprints/two_lead_button.js @@ -0,0 +1,19 @@ +module.exports = { + nets: { + from: undefined, + to: undefined, + }, + body: p => ` + (module TwoLeadButton + (layer "F.Cu") + + ${p.at /* parametric position */} + + (fp_text reference "B1" (at 0 0 unlocked) (layer "F.SilkS") (effects (font (size 1 1) (thickness 0.15)))) + (fp_text value "Button" (at 0 2.54 unlocked) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15)))) + (fp_text user "Button" (at 0 0 unlocked) (layer "F.Fab") (effects (font (size 1 1) (thickness 0.15)))) + (pad "1" smd roundrect (at -2.2 0) (size 1 2) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25) ${p.net.from.str}) + (pad "2" smd roundrect (at 2.2 0) (size 1 2) (layers "F.Cu" "F.Paste" "F.Mask") (roundrect_rratio 0.25) ${p.net.to.str}) + ) + ` +}