Initial commit
This commit is contained in:
commit
6cb3558ad5
|
@ -0,0 +1,3 @@
|
|||
[submodule "scad/common"]
|
||||
path = scad/common
|
||||
url = https://git.sixteenmillimeter.com/modules/common.git
|
|
@ -0,0 +1,15 @@
|
|||
# Knobs
|
||||
|
||||
This repo contains a parametric knob generator for quickly generating tactile knobs for standard metric bolts.
|
||||
|
||||
## Example
|
||||
|
||||
```scad
|
||||
use <./scad/knob.scad>;
|
||||
|
||||
knob(H = 10, D = 14, DEPTH = 4, BOLT = "M4", TYPE = "hex");
|
||||
|
||||
```
|
||||
|
||||
This will generate a knob that is 10mm high, has a diameter of 14m and takes an M4 hex bolt that sits 4mm from the bottom.
|
||||
An M4 bolt can be dropped in, or an M4 nut.
|
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
|
@ -0,0 +1,3 @@
|
|||
#!/bin/bash
|
||||
|
||||
bash ./scad/common/scad.sh ./scad/knob.scad
|
|
@ -0,0 +1 @@
|
|||
Subproject commit e2eeb27f173d739a174c0d147bcb62a16859e2d9
|
|
@ -0,0 +1,68 @@
|
|||
use <./common/common.scad>
|
||||
use <./common/Triangles.scad>;
|
||||
|
||||
module knob (H = 12, D = 24, DEPTH = 4, BOLT = "M4", TYPE = "hex") {
|
||||
NOTCH = 1;
|
||||
N = ceil(D * 3.14 / 1.5);
|
||||
BOT = 12;
|
||||
BOT_H = 2;
|
||||
THICKNESS = 4.25;
|
||||
ID = D - THICKNESS;
|
||||
supported = true;
|
||||
echo(N);
|
||||
|
||||
difference() {
|
||||
union () {
|
||||
cylinder(r = D / 2, h = H, center = true, $fn = 360);
|
||||
translate([0, 0, -(H / 2) - (BOT_H / 2)]) {
|
||||
cylinder(r = BOT / 2, h = 2, center = true, $fn = 360);
|
||||
}
|
||||
}
|
||||
if (BOLT == "M3") {
|
||||
cylinder(r = 3.1 / 2, h = H * 2, center = true, $fn = 60);
|
||||
} else if (BOLT == "M4") {
|
||||
cylinder(r = 4.25 / 2, h = H * 2, center = true, $fn = 60);
|
||||
} else if (BOLT == "M5") {
|
||||
cylinder(r = 5.1 / 2, h = H * 2, center = true, $fn = 60);
|
||||
} else {
|
||||
supported = false;
|
||||
}
|
||||
assert(supported, "Bolt size not supported!");
|
||||
|
||||
//hollow inner cylinder
|
||||
translate([0, 0, DEPTH]) cylinder(r = ID / 2, h = H, center = true, $fn = 360);
|
||||
if (BOLT == "M4" && TYPE == "hex") {
|
||||
translate([0, 0, -(H / 2) + DEPTH - 1.4]) m4_nut();
|
||||
} else if (BOLT == "M5" && TYPE == "hex" ) {
|
||||
translate([0, 0, -(H / 2) + DEPTH - 1.4]) m5_nut();
|
||||
} else if (BOLT == "M5" && TYPE == "socket") {
|
||||
translate([0, 0, -(H / 2) + DEPTH - 1.4]) m5_bolt();
|
||||
}
|
||||
|
||||
//grips
|
||||
for(i = [0 : N]) {
|
||||
rotate([0, 0, i * (360 / N)]) {
|
||||
translate([D / 2.87, D / 2.87, 0]) {
|
||||
Right_Angled_Triangle(a = NOTCH, b = NOTCH, height = 22, centerXYZ=[true, true, true]);
|
||||
}
|
||||
}
|
||||
}
|
||||
//taper top
|
||||
translate([0, 0, H / 2 - 0.7]) difference () {
|
||||
cylinder(r = D / 2 + 2, h = 2, center = true, $fn = 360);
|
||||
cylinder(r1 = D / 2 + 1, r2 = D / 2 - 1, h = 2.01, center = true, $fn = 360);
|
||||
}
|
||||
//taper bottom
|
||||
translate([0, 0, -H / 2 + 0.7]) difference () {
|
||||
cylinder(r = D / 2 + 2, h = 2, center = true, $fn = 360);
|
||||
cylinder(r2 = D / 2 + 1, r1 = D / 2 - 1, h = 2.01, center = true, $fn = 360);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
PART = "m4_hex_10h_14d";
|
||||
|
||||
if (PART == "m4_hex_10h_14d") {
|
||||
knob(H = 10, D = 14, DEPTH = 4, BOLT = "M4", TYPE = "hex");
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue