diff options
Diffstat (limited to 'ergogen/footprints')
| -rw-r--r-- | ergogen/footprints/mx6c_ulp.js | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/ergogen/footprints/mx6c_ulp.js b/ergogen/footprints/mx6c_ulp.js new file mode 100644 index 0000000..5a2d789 --- /dev/null +++ b/ergogen/footprints/mx6c_ulp.js @@ -0,0 +1,130 @@ +module.exports = { + params: { + designator: 's', + side: 'f', + reversible: false, + hotswap: false, + include_silkscreen: true, + include_keycaps: true, + keycap_width: 17.5, + keycap_height: 16.5, + switch_3dmodel_filename: '', + switch_3dmodel_xyz_offset: [-5.5, 0, 3], + switch_3dmodel_xyz_rotation: [0, 0, -90], + switch_3dmodel_xyz_scale: [1, 1, 1], + keycap_3dmodel_filename: '', + keycap_3dmodel_xyz_offset: [-12.18, -14.8, 4], + keycap_3dmodel_xyz_rotation: [180, 0, 0], + keycap_3dmodel_xyz_scale: [1, 1, 1], + from: undefined, + to: undefined, + }, + body: p => { + const keycap_xo = 0.5 * p.keycap_width + const keycap_yo = 0.5 * p.keycap_height + + return ` + (footprint "Cherry_ULP_HANDSOLDER" (version 20221018) (generator pcbnew) + (layer "F.Cu") + ${p.at} + (attr smd) + (property "Reference" "${p.ref}" + (at -0.05 -7.5 ${p.r}) + (unlocked yes) + (layer "F.SilkS") + ${p.ref_hide} + (effects (font (size 1 1) (thickness 0.15))) + ) + (property "Value" "ULP_SW" + (at 0 0 ${p.r}) + (unlocked yes) + (layer "F.Fab") + (hide yes) + (effects (font (size 1 1) (thickness 0.15))) + ) + ${p.include_silkscreen ? ` + (fp_poly + (pts + (xy -7.1 -6.4) (xy 7.1 -6.4) (xy 7.1 6.4) (xy -7.1 6.4) + ) + (stroke (width 0.1) (type solid)) + (fill no) + (layer "F.SilkS") + ) + ` : ''} + (fp_poly + (pts + (xy -6.8 -6.1) (xy 6.8 -6.1) (xy 6.8 6.1) (xy -6.8 6.1) + ) + (stroke (width 0.1) (type solid)) + (fill no) + (layer "F.CrtYd") + ) + ${p.include_keycaps ? ` + (fp_rect (start ${keycap_xo} ${keycap_yo}) (end ${-keycap_xo} ${-keycap_yo}) + (stroke (width 0.15) (type solid)) + (fill no) + (layer "Dwgs.User") + ) + ` : ''} + (fp_line (start -2.4 4.5) (end -2.4 3.4) + (stroke (width 0.05) (type default)) + (layer "Edge.Cuts") + ) + (fp_line (start -1.4 2.4) (end 2.6 2.4) + (stroke (width 0.05) (type default)) + (layer "Edge.Cuts") + ) + (fp_line (start 2.6 5.5) (end -1.4 5.5) + (stroke (width 0.05) (type default)) + (layer "Edge.Cuts") + ) + (fp_line (start 3.6 3.4) (end 3.6 4.5) + (stroke (width 0.05) (type default)) + (layer "Edge.Cuts") + ) + (fp_arc (start -2.4 3.4) (mid -2.107107 2.692893) (end -1.4 2.4) + (stroke (width 0.05) (type default)) + (layer "Edge.Cuts") + ) + (fp_arc (start -1.4 5.5) (mid -2.107107 5.207107) (end -2.4 4.5) + (stroke (width 0.05) (type default)) + (layer "Edge.Cuts") + ) + (fp_arc (start 2.6 2.4) (mid 3.307107 2.692893) (end 3.6 3.4) + (stroke (width 0.05) (type default)) + (layer "Edge.Cuts") + ) + (fp_arc (start 3.6 4.5) (mid 3.307108 5.207107) (end 2.6 5.5) + (stroke (width 0.05) (type default)) + (layer "Edge.Cuts") + ) + (pad "" np_thru_hole circle (at -5.8 1.2 ${p.r}) (size 1.05 1.05) (drill 1.05) (layers "*.Cu" "*.Mask")) + (pad "" np_thru_hole circle (at -5.8 2.75 ${p.r}) (size 1.05 1.05) (drill 1.05) (layers "*.Cu" "*.Mask")) + (pad "" np_thru_hole oval (at 5.8 -2.96 ${p.r}) (size 1.2 1.8) (drill oval 1.2 1.8) (layers "*.Cu" "*.Mask")) + (pad "" np_thru_hole circle (at 5.8 3.26 ${p.r}) (size 1.2 1.2) (drill 1.2) (layers "*.Cu" "*.Mask")) + (pad "1" thru_hole circle (at -0.5 2.4 ${p.r}) (size 1.3 1.3) (drill 1.1) (layers "*.Cu" "*.Mask") (remove_unused_layers no) ${p.from}) + (pad "2" thru_hole circle (at 1.8 2.4 ${p.r}) (size 1.3 1.3) (drill 1.1) (layers "*.Cu" "*.Mask") (remove_unused_layers no) ${p.to}) + (pad "3" smd rect (at -6.4 -4.6 ${p.r}) (size 2.15 5) (layers "F.Cu" "F.Mask" "F.Paste")) + (pad "3" smd rect (at -6.4 5.3 ${p.r}) (size 2.15 3.2) (layers "F.Cu" "F.Mask" "F.Paste")) + (pad "3" smd rect (at 6.4 -5.75 ${p.r}) (size 2 2.7) (layers "F.Cu" "F.Mask" "F.Paste")) + (pad "3" smd rect (at 6.4 0 ${p.r}) (size 2 2.6) (layers "F.Cu" "F.Mask" "F.Paste")) + (pad "3" smd rect (at 6.4 5.75 ${p.r}) (size 2 2.3) (layers "F.Cu" "F.Mask" "F.Paste")) + ${p.switch_3dmodel_filename ? ` + (model ${p.switch_3dmodel_filename} + (offset (xyz ${p.switch_3dmodel_xyz_offset[0]} ${p.switch_3dmodel_xyz_offset[1]} ${p.switch_3dmodel_xyz_offset[2]})) + (scale (xyz ${p.switch_3dmodel_xyz_scale[0]} ${p.switch_3dmodel_xyz_scale[1]} ${p.switch_3dmodel_xyz_scale[2]})) + (rotate (xyz ${p.switch_3dmodel_xyz_rotation[0]} ${p.switch_3dmodel_xyz_rotation[1]} ${p.switch_3dmodel_xyz_rotation[2]})) + ) + ` : ''} + ${p.keycap_3dmodel_filename ? ` + (model ${p.keycap_3dmodel_filename} + (offset (xyz ${p.keycap_3dmodel_xyz_offset[0]} ${p.keycap_3dmodel_xyz_offset[1]} ${p.keycap_3dmodel_xyz_offset[2]})) + (scale (xyz ${p.keycap_3dmodel_xyz_scale[0]} ${p.keycap_3dmodel_xyz_scale[1]} ${p.keycap_3dmodel_xyz_scale[2]})) + (rotate (xyz ${p.keycap_3dmodel_xyz_rotation[0]} ${p.keycap_3dmodel_xyz_rotation[1]} ${p.keycap_3dmodel_xyz_rotation[2]})) + ) + ` : ''} + ) + ` + } +} |
