From b91dba0af534d1c9bcb211f6deefc44e35b59d69 Mon Sep 17 00:00:00 2001 From: Michael van Eerd Date: Sat, 27 Nov 2021 11:49:52 +0100 Subject: [PATCH] (feat) footprints: Add MX 3d model --- src/footprints/mx.js | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/footprints/mx.js b/src/footprints/mx.js index 4bfb859be..f575cb923 100644 --- a/src/footprints/mx.js +++ b/src/footprints/mx.js @@ -21,7 +21,9 @@ module.exports = { class: 'S', hotswap: false, reverse: false, - keycaps: false + keycaps: false, + // By placing a model in the path specified below KiCad will show it in the 3D viewer + model: './3d/SW_Cherry_MX_PCB.stp' }, body: p => { const standard = ` @@ -75,19 +77,19 @@ module.exports = { ` } } - if(p.param.reverse){ + return ` ${standard} ${p.param.keycaps ? keycap : ''} ${pins('-', '', 'B')} - ${pins('', '-', 'F')}) - ` - } else { - return ` - ${standard} - ${p.param.keycaps ? keycap : ''} - ${pins('-', '', 'B')}) + ${p.param.reverse ? pins('', '-', 'F') : ''} + + (model ${p.param.model} + (at (xyz 0 0 0)) + (scale (xyz 1 1 1)) + (rotate (xyz 0 0 0)) + ) + ) ` - } } } \ No newline at end of file