From 58cdf63f9f15f513d87bcc8a73a7574d466c555b Mon Sep 17 00:00:00 2001 From: Jan-Henrik Bruhn Date: Sat, 8 Feb 2025 13:30:18 +0100 Subject: [PATCH] Add parameter sets and jobs for buttons --- .github/workflows/build-stls.yml | 33 +++++++++++++++++++++++++-- hardware/case/buttons.json | 38 ++++++++++++++++++++++++++++++++ hardware/case/buttons.scad | 17 ++++++++++---- 3 files changed, 82 insertions(+), 6 deletions(-) create mode 100644 hardware/case/buttons.json diff --git a/.github/workflows/build-stls.yml b/.github/workflows/build-stls.yml index 25b323d..c8350c1 100644 --- a/.github/workflows/build-stls.yml +++ b/.github/workflows/build-stls.yml @@ -13,13 +13,42 @@ jobs: uses: actions/checkout@v2 with: submodules: true - - name: Generate Models + - name: Generate Case uses: pkoehlers/openscad-build-action@54267e4b137c716efa15a48bd53f743a23fea606 with: input-file: 'hardware/case/case.scad' output-file: 'case.stl' + - name: Generate Buttons + uses: pkoehlers/openscad-build-action@54267e4b137c716efa15a48bd53f743a23fea606 + with: + input-file: 'hardware/case/buttons.scad' + output-file: 'buttons.stl' + customizer-parameter-file: 'hardware/case/buttons.json' + customizer-parameter-set: 'Buttons' + - name: Generate Inlay + uses: pkoehlers/openscad-build-action@54267e4b137c716efa15a48bd53f743a23fea606 + with: + input-file: 'hardware/case/buttons.scad' + output-file: 'buttons-tpu-inlay.stl' + customizer-parameter-file: 'hardware/case/buttons.json' + customizer-parameter-set: 'Inlay' + - name: Generate Inlay + uses: pkoehlers/openscad-build-action@54267e4b137c716efa15a48bd53f743a23fea606 + with: + input-file: 'hardware/case/buttons.scad' + output-file: 'buttons-black-blockers.stl' + customizer-parameter-file: 'hardware/case/buttons.json' + customizer-parameter-set: 'Blockers' - name: Archive uses: actions/upload-artifact@v4 with: name: case - path: case.stl \ No newline at end of file + path: case.stl + - name: Archive + uses: actions/upload-artifact@v4 + with: + name: buttons + path: | + buttons.stl + buttons-tpu-inlay.stl + buttons-black-blockers.stl \ No newline at end of file diff --git a/hardware/case/buttons.json b/hardware/case/buttons.json new file mode 100644 index 0000000..fdd567e --- /dev/null +++ b/hardware/case/buttons.json @@ -0,0 +1,38 @@ +{ + "fileFormatVersion": "1", + "parameterSets": { + "Buttons": { + "cross": "true", + "height": "5.2999999999999998", + "inlayslack": "1", + "only_blockers": "false", + "only_inlay": "false", + "px": "11.43", + "py": "11.4", + "rubberslack": "0.59999999999999998", + "s": "8.5" + }, + "Inlay": { + "cross": "true", + "height": "5.2999999999999998", + "inlayslack": "1", + "only_blockers": "false", + "only_inlay": "true", + "px": "11.43", + "py": "11.4", + "rubberslack": "0.59999999999999998", + "s": "8.5" + }, + "Blockers": { + "cross": "false", + "height": "5.2999999999999998", + "inlayslack": "1", + "only_blockers": "true", + "only_inlay": "false", + "px": "11.43", + "py": "11.4", + "rubberslack": "0.59999999999999998", + "s": "8.5" + } + } +} diff --git a/hardware/case/buttons.scad b/hardware/case/buttons.scad index 0199007..306b1de 100644 --- a/hardware/case/buttons.scad +++ b/hardware/case/buttons.scad @@ -16,7 +16,12 @@ w = 0.42*3; h = 0.12*3; cross = true; -/* + +only_blockers = false; + +only_inlay = false; + +if(!only_blockers && !only_inlay) { intersection() { difference() { union() { @@ -57,11 +62,14 @@ translate([x * px + s/2, y * py, inlayheight / 2]) cube([3.25, s/3, inlayheight] for(y=[0:8-1]) translate([-1 * px + s - 1, y * py, inlayheight / 2]) cube([2.75, s/4, inlayheight], center = true); -*/ +} +if (only_blockers && !only_inlay) { color("blue") for(x=[0:8-1]) for(y=[0:8-1]) translate([x * px - s/2+.15, y * py, (height - 2) / 2]) cube([.4, s-3, height - 2], center = true); -/* +} + +if (!only_blockers && only_inlay) { color("blue") translate([0, 0, inlayheight]) difference() { @@ -70,4 +78,5 @@ color("blue") translate([0, 0, inlayheight]) difference() { for(x=[0:8-1]) for(y=[0:8-1]) translate([x * px, y * py, height / 2]) roundedcube([s+rubberslack, s + rubberslack, height], center = true, radius = 1.5, "zmax"); -}*/ \ No newline at end of file +} +} \ No newline at end of file