Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
factoryjp committed Sep 8, 2023
0 parents commit 02e033d
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/openscad_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Generate and Deploy OpenSCAD preview to GitHub Pages

on:
push:
paths:
- "**.scad"

jobs:
build_and_deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install OpenSCAD
run: sudo apt-get install -y openscad

- name: Generate STL files
run: |
for scad in $(ls *.scad); do
openscad -o ${scad%.scad}.stl $scad
done
- name: Deploy to GitHub Pages
run: |
git checkout -b gh-pages
git add *.stl
git commit -m "Update STL files generated by GitHub Actions"
git push -f origin gh-pages
38 changes: 38 additions & 0 deletions chocv1_08u/test1.scad
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
$fs = 0.1;

module rounded_cube (size, r) {
h = 0.0001; // cylinder の高さ (適当な値)
minkowski () {
cube([size[0] - r*2, size[1] - r*2, size[2] - h], center = true);
cylinder(r = r, h = h);
}
}

module keycap_outer_shape (key_bottom_size, key_top_size, key_top_height) {
hull () {
translate([0, 0, key_top_height])
rounded_cube([key_top_size, key_top_size, 0.01], 1);
rounded_cube([key_bottom_size, key_bottom_size, 0.01], 1);
}
}

module keycap_shape () {
difference () {
keycap_outer_shape(16.5, 14.5, 3.5);
// 一回り小さいキーキャップ外形
keycap_outer_shape(14.5, 12.5, 1.5);
}
}

keycap_shape();

module kailh_choc_v1_stem() {

// Latches for switch housing
translate([-2.85, 0, 0])
cube([1, 2, 3], center=true);
translate([2.85, 0, 0])
cube([1, 2, 3], center=true);
}

kailh_choc_v1_stem();

0 comments on commit 02e033d

Please sign in to comment.