dev: add screw points and mounting points
This commit is contained in:
parent
3c9ec7457f
commit
dc07ea0149
2 changed files with 104 additions and 2 deletions
28
config.yaml
28
config.yaml
|
|
@ -20,8 +20,11 @@ units:
|
||||||
|
|
||||||
points:
|
points:
|
||||||
zones:
|
zones:
|
||||||
|
# main key matrix
|
||||||
matrix:
|
matrix:
|
||||||
|
anchor.shift: [170, -170]
|
||||||
key:
|
key:
|
||||||
|
tags: [key]
|
||||||
padding: ky
|
padding: ky
|
||||||
spread: kx
|
spread: kx
|
||||||
columns:
|
columns:
|
||||||
|
|
@ -53,8 +56,10 @@ points:
|
||||||
bottom.row_net: rbottom
|
bottom.row_net: rbottom
|
||||||
home.row_net: rhome
|
home.row_net: rhome
|
||||||
top.row_net: rtop
|
top.row_net: rtop
|
||||||
|
# thumb clusters
|
||||||
thumbs:
|
thumbs:
|
||||||
key:
|
key:
|
||||||
|
tags: [key]
|
||||||
spread: 22
|
spread: 22
|
||||||
anchor:
|
anchor:
|
||||||
ref: matrix_inner_bottom
|
ref: matrix_inner_bottom
|
||||||
|
|
@ -74,6 +79,19 @@ points:
|
||||||
rows:
|
rows:
|
||||||
cluster.row_net: rthumbs
|
cluster.row_net: rthumbs
|
||||||
# screw points
|
# screw points
|
||||||
|
screws:
|
||||||
|
key.tags: [screw]
|
||||||
|
key.spread: 0
|
||||||
|
anchor:
|
||||||
|
ref: matrix_outer_top
|
||||||
|
columns:
|
||||||
|
left_top.key.shift: [khx+0.3, -3.5]
|
||||||
|
left_bottom.key.shift: [khx+0.3, -ky-3.5]
|
||||||
|
middle_top.key.shift: [2kx+khx+0.3, ky-3.5]
|
||||||
|
middle_bottom.key.shift: [3kx+6, -ky-7]
|
||||||
|
right_top.key.shift: [4kx+khx, +6.5]
|
||||||
|
right_bottom.key.shift: [5kx+khx+2, -2ky+2]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
outlines:
|
outlines:
|
||||||
|
|
@ -138,7 +156,7 @@ pcbs:
|
||||||
# hotswap choc
|
# hotswap choc
|
||||||
switches:
|
switches:
|
||||||
what: choc
|
what: choc
|
||||||
where: true
|
where: [key]
|
||||||
params:
|
params:
|
||||||
keycaps: true
|
keycaps: true
|
||||||
#keycaps: false # outline on the pcb
|
#keycaps: false # outline on the pcb
|
||||||
|
|
@ -150,7 +168,7 @@ pcbs:
|
||||||
# smd diodes
|
# smd diodes
|
||||||
diodes:
|
diodes:
|
||||||
what: combo_diode
|
what: combo_diode
|
||||||
where: true
|
where: [key]
|
||||||
params:
|
params:
|
||||||
include_smd: true
|
include_smd: true
|
||||||
include_tht: false
|
include_tht: false
|
||||||
|
|
@ -193,4 +211,10 @@ pcbs:
|
||||||
ref: matrix_inner_home
|
ref: matrix_inner_home
|
||||||
shift: [kx+2, 0]
|
shift: [kx+2, 0]
|
||||||
|
|
||||||
|
screws:
|
||||||
|
what: mounting_hole
|
||||||
|
params:
|
||||||
|
drill: 3.6
|
||||||
|
where: [screw]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
78
footprints/mounting_hole.js
Normal file
78
footprints/mounting_hole.js
Normal file
|
|
@ -0,0 +1,78 @@
|
||||||
|
// Author: @infused-kim
|
||||||
|
//
|
||||||
|
// Description:
|
||||||
|
// Simple mounting hole with gold rim.
|
||||||
|
//
|
||||||
|
// Parameters:
|
||||||
|
// - outline: The width of the gold rim around the hole (Default: 0.8mm)
|
||||||
|
// - drill: The actual size for the hole (Default 2.2mm - for m2 screws)
|
||||||
|
// - drill_y: The height if you want an oval hole (Default: off)
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
params: {
|
||||||
|
designator: "H",
|
||||||
|
outline: 0.8,
|
||||||
|
drill: 2.2,
|
||||||
|
drill_y: 0,
|
||||||
|
},
|
||||||
|
body: (p) => {
|
||||||
|
if (p.drill_y == 0) {
|
||||||
|
p.drill_y = p.drill;
|
||||||
|
}
|
||||||
|
|
||||||
|
const size_x = p.drill + p.outline * 2;
|
||||||
|
const size_y = p.drill_y + p.outline * 2;
|
||||||
|
|
||||||
|
const courtyard_offset = 0.25;
|
||||||
|
const courtyard_x = size_x / 2 + courtyard_offset;
|
||||||
|
const courtyard_y = size_y / 2 + courtyard_offset;
|
||||||
|
|
||||||
|
const top = `
|
||||||
|
(module mounting_hole (layer F.Cu) (tedit 64B5A986)
|
||||||
|
${p.at /* parametric position */}
|
||||||
|
(fp_text reference "${p.ref}" (at 0 3) (layer F.SilkS) ${
|
||||||
|
p.ref_hide
|
||||||
|
}
|
||||||
|
(effects (font (size 1 1) (thickness 0.15)))
|
||||||
|
)
|
||||||
|
`;
|
||||||
|
|
||||||
|
const pad_circle = `
|
||||||
|
(pad "" thru_hole circle (at 0 0 180) (size ${size_x} ${size_y}) (drill ${p.drill}) (layers *.Cu *.Mask))
|
||||||
|
`;
|
||||||
|
const courtyard_circle = `
|
||||||
|
(fp_circle (center 0 0) (end -${courtyard_x} 0) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_circle (center 0 0) (end -${courtyard_x} 0) (layer B.CrtYd) (width 0.05))
|
||||||
|
`;
|
||||||
|
const pad_oval = `
|
||||||
|
(pad "" thru_hole oval (at 0 0 180) (size ${size_x} ${size_y}) (drill oval ${p.drill} ${p.drill_y}) (layers *.Cu *.Mask))
|
||||||
|
`;
|
||||||
|
const courtyard_oval = `
|
||||||
|
(fp_line (start ${courtyard_x} -${courtyard_y}) (end ${courtyard_x} ${courtyard_y}) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start -${courtyard_x} -${courtyard_y}) (end -${courtyard_x} ${courtyard_y}) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start -${courtyard_x} ${courtyard_y}) (end ${courtyard_x} ${courtyard_y}) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start -${courtyard_x} -${courtyard_y}) (end ${courtyard_x} -${courtyard_y}) (layer F.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start -${courtyard_x} ${courtyard_y}) (end ${courtyard_x} ${courtyard_y}) (layer B.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start -${courtyard_x} ${courtyard_y}) (end -${courtyard_x} -${courtyard_y}) (layer B.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start -${courtyard_x} -${courtyard_y}) (end ${courtyard_x} -${courtyard_y}) (layer B.CrtYd) (width 0.05))
|
||||||
|
(fp_line (start ${courtyard_x} ${courtyard_y}) (end ${courtyard_x} -${courtyard_y}) (layer B.CrtYd) (width 0.05))
|
||||||
|
`;
|
||||||
|
|
||||||
|
const bottom = `
|
||||||
|
)
|
||||||
|
`;
|
||||||
|
|
||||||
|
let final = top;
|
||||||
|
if (size_x == size_y) {
|
||||||
|
final += pad_circle;
|
||||||
|
final += courtyard_circle;
|
||||||
|
} else {
|
||||||
|
final += pad_oval;
|
||||||
|
final += courtyard_oval;
|
||||||
|
}
|
||||||
|
|
||||||
|
final += bottom;
|
||||||
|
|
||||||
|
return final;
|
||||||
|
},
|
||||||
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue