Skip to content

Commit

Permalink
Adds case with mounting hole but without wall
Browse files Browse the repository at this point in the history
  • Loading branch information
KostkaBrukowa committed Nov 2, 2024
1 parent 1209532 commit 13f7929
Show file tree
Hide file tree
Showing 5 changed files with 228 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
cp ./text.js ./node_modules/ergogen/src/footprints
cp ./footprints/promicro_flippable.js ./node_modules/ergogen/src/footprints
cp ./footprints/reset_button.js ./node_modules/ergogen/src/footprints
cp ./footprints/mountinghole.js ./node_modules/ergogen/src/footprints
npm run gen
- name: Export DSN for main PCB
uses: ./.github/actions/export-dsn
Expand Down
102 changes: 99 additions & 3 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ units:
px: 2
py: 2
ring_rotate: -10
# Defaults to M2 Screws
screwSize: 1.5
standoffSize: 2.5
points:
zones:
matrix:
Expand Down Expand Up @@ -255,6 +258,55 @@ outlines:
size: [kx, ky]
bound: false
corner: 1
mounting:
- what: circle
radius: screwSize
where:
ref: [matrix_pinky_top]
shift: [0.37kx, 0.65ky]

- what: circle
radius: screwSize
where:
ref: [matrix_inner_top]
shift: [0.48kx, -0.5ky]

- what: circle
radius: screwSize
where:
ref: [matrix_pinky_bottom]
shift: [0.7kx, -0.2ky]

- what: circle
radius: screwSize
where:
ref: [thumbfan_right_thumb]
shift: [0, 0.8ky]
standoff:
- what: circle
radius: standoffSize
where:
ref: [matrix_pinky_top]
shift: [0.37kx, 0.65ky]

- what: circle
radius: standoffSize
where:
ref: [matrix_inner_top]
shift: [0.48kx, -0.5ky]

- what: circle
radius: standoffSize
where:
ref: [matrix_pinky_bottom]
shift: [0.7kx, -0.2ky]

- what: circle
radius: standoffSize
where:
ref: [thumbfan_right_thumb]
shift: [0, 0.8ky]

base_outline:
main:
what: outline
Expand Down Expand Up @@ -292,7 +344,6 @@ outlines:
main:
what: outline
name: base_outline

pcbs:
board:
outlines:
Expand All @@ -301,12 +352,13 @@ pcbs:
layer: Edge.Cuts
footprints:
choc:
what: chocmini
what: choc
where: true
params:
keycaps: true
reverse: true
from: "{{col_net}}"
hotswap: true
from: "{{column_net}}"
to: GND
mcu_l:
what: promicro
Expand Down Expand Up @@ -353,3 +405,47 @@ pcbs:
layer: B.SilkS
text: "Dupa Sweep\\nby KostkaBrukowa"
justify: right mirror
hole_top_left:
what: mountinghole
where:
ref: [matrix_pinky_top]
shift: [0.37kx, 0.65ky]

hole_top_right:
what: mountinghole
where:
ref: [matrix_inner_top]
shift: [0.48kx, -0.5ky]

hole_bottom_left:
what: mountinghole
where:
ref: [matrix_pinky_bottom]
shift: [0.7kx, -0.2ky]

hole_bottom_right:
what: mountinghole
where:
ref: [thumbfan_right_thumb]
shift: [0, 0.8ky]

cases:
bottom:
- name: base_outline
extrude: 1
_holes:
- name: mounting
extrude: 4
_standoffs:
- name: standoff
extrude: 4
case:
- what: case
name: _standoffs
operation: add
- what: case
name: _holes
operation: subtract
- what: case
name: bottom
operation: add
97 changes: 96 additions & 1 deletion ergogen/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ units:
px: 2
py: 2
ring_rotate: -10
# Defaults to M2 Screws
screwSize: 1.5
standoffSize: 2.5
points:
zones:
matrix:
Expand Down Expand Up @@ -255,6 +258,55 @@ outlines:
size: [kx, ky]
bound: false
corner: 1
mounting:
- what: circle
radius: screwSize
where:
ref: [matrix_pinky_top]
shift: [0.37kx, 0.65ky]

- what: circle
radius: screwSize
where:
ref: [matrix_inner_top]
shift: [0.48kx, -0.5ky]

- what: circle
radius: screwSize
where:
ref: [matrix_pinky_bottom]
shift: [0.7kx, -0.2ky]

- what: circle
radius: screwSize
where:
ref: [thumbfan_right_thumb]
shift: [0, 0.8ky]
standoff:
- what: circle
radius: standoffSize
where:
ref: [matrix_pinky_top]
shift: [0.37kx, 0.65ky]

- what: circle
radius: standoffSize
where:
ref: [matrix_inner_top]
shift: [0.48kx, -0.5ky]

- what: circle
radius: standoffSize
where:
ref: [matrix_pinky_bottom]
shift: [0.7kx, -0.2ky]

- what: circle
radius: standoffSize
where:
ref: [thumbfan_right_thumb]
shift: [0, 0.8ky]

base_outline:
main:
what: outline
Expand Down Expand Up @@ -292,7 +344,6 @@ outlines:
main:
what: outline
name: base_outline

pcbs:
board:
outlines:
Expand Down Expand Up @@ -353,3 +404,47 @@ pcbs:
layer: B.SilkS
text: "Dupa Sweep\\nby KostkaBrukowa"
justify: right mirror
hole_top_left:
what: mountinghole
where:
ref: [matrix_pinky_top]
shift: [0.37kx, 0.65ky]

hole_top_right:
what: mountinghole
where:
ref: [matrix_inner_top]
shift: [0.48kx, -0.5ky]

hole_bottom_left:
what: mountinghole
where:
ref: [matrix_pinky_bottom]
shift: [0.7kx, -0.2ky]

hole_bottom_right:
what: mountinghole
where:
ref: [thumbfan_right_thumb]
shift: [0, 0.8ky]

cases:
bottom:
- name: base_outline
extrude: 1
_holes:
- name: mounting
extrude: 4
_standoffs:
- name: standoff
extrude: 4
case:
- what: case
name: _standoffs
operation: add
- what: case
name: _holes
operation: subtract
- what: case
name: bottom
operation: add
1 change: 1 addition & 0 deletions ergogen/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module.exports = {
diode: require('./diode'),
jstph: require('./jstph'),
jumper: require('./jumper'),
mountinghole: require('./mountinghole'),
mx: require('./mx'),
oled: require('./oled'),
omron: require('./omron'),
Expand Down
31 changes: 31 additions & 0 deletions footprints/mountinghole.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// MountingHole_2.2mm_M2_Pad_Via
// TODO add more sizes as param?
module.exports = {
nets: {
net: undefined
},
params: {
class: 'HOLE',
},
body: p => `
(module "MountingHole_2.2mm_M2_Pad_Via" (version 20210722) (generator pcbnew) (layer "F.Cu")
(tedit 56DDB9C7)
${p.at /* parametric position */}
(fp_text reference "${p.ref}" (at 0 -3.2) (layer "F.SilkS") ${p.ref_hide}
(effects (font (size 1 1) (thickness 0.15)))
(tstamp b68bb25c-687d-44b1-b966-dad4cac66b35)
)
(fp_circle (center 0 0) (end 2.45 0) (layer "F.CrtYd") (width 0.05) (fill none) (tstamp b2688462-c375-45d3-9095-3425fb17c88f))
(pad "1" thru_hole circle locked (at 1.166726 1.166726) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask) (tstamp 2a7fc905-328f-4bbb-9222-ca8d15d03a86))
(pad "1" thru_hole circle locked (at 0 0) (size 4.4 4.4) (drill 2.2) (layers *.Cu *.Mask) (tstamp 47ee1d53-0551-4b6d-bc24-3f3f14c73c36))
(pad "1" thru_hole circle locked (at 0 1.65) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask) (tstamp 4eef65bc-4add-40d7-8319-14dcdbae0d44))
(pad "1" thru_hole circle locked (at 1.166726 -1.166726) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask) (tstamp 56155f4d-2ebc-4ad4-8d82-7aa7846deba8))
(pad "1" thru_hole circle locked (at -1.65 0) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask) (tstamp 787d6162-1d3c-4def-859e-6532ce27c1ef))
(pad "1" thru_hole circle locked (at -1.166726 -1.166726) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask) (tstamp 8d699d12-7099-4814-bbe6-11bc74c6e8b2))
(pad "1" thru_hole circle locked (at -1.166726 1.166726) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask) (tstamp 95ab0420-a56b-46ee-98ad-5072a1a93a6f))
(pad "1" thru_hole circle locked (at 1.65 0) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask) (tstamp cde0acf2-b3b4-46de-9f6e-3ab519744000))
(pad "1" thru_hole circle locked (at 0 -1.65) (size 0.7 0.7) (drill 0.4) (layers *.Cu *.Mask) (tstamp ff0de415-ae11-46fb-b780-c24aee621212))
)`
}

0 comments on commit 13f7929

Please sign in to comment.