Skip to content

Commit 5f3abab

Browse files
committed
Add bottom remix and radius_gauge
1 parent 1eb36fa commit 5f3abab

File tree

3 files changed

+99
-4
lines changed

3 files changed

+99
-4
lines changed

Makefile

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ clean:
66
rm -rf stls/
77

88
all: \
9+
stls/remix_bottom.3mf \
910
$(patsubst %,stls/classic_concave_R%.3mf,$(shell seq 1 30)) \
1011
$(patsubst %,stls/classic_convex_R%.3mf,$(shell seq 1 30)) \
1112
$(patsubst %,stls/remix_concave_R%.3mf,$(shell seq 1 30)) \
@@ -17,6 +18,7 @@ stls/classic_concave_R%.3mf: radius_gauge.scad
1718
-D 'FLIP=true' \
1819
-D 'TYPE="concave"' \
1920
-D 'TAB=false' \
21+
-D 'ROTATE_TEXT=false' \
2022
-D 'BASE_WIDTH=35' \
2123
-D 'CHAMFER_WIDTH=1' \
2224
-D 'RADIUS=$*' \
@@ -28,6 +30,7 @@ stls/classic_convex_R%.3mf: radius_gauge.scad
2830
-D 'FLIP=true' \
2931
-D 'TYPE="convex"' \
3032
-D 'TAB=false' \
33+
-D 'ROTATE_TEXT=false' \
3134
-D 'BASE_WIDTH=35' \
3235
-D 'CHAMFER_WIDTH=1' \
3336
-D 'RADIUS=$*' \
@@ -39,6 +42,7 @@ stls/remix_concave_R%.3mf: radius_gauge.scad
3942
-D 'FLIP=true' \
4043
-D 'TYPE="concave"' \
4144
-D 'TAB=true' \
45+
-D 'ROTATE_TEXT=true' \
4246
-D 'BASE_WIDTH=34.9' \
4347
-D 'CHAMFER_WIDTH=2' \
4448
-D 'RADIUS=$*' \
@@ -50,7 +54,12 @@ stls/remix_convex_R%.3mf: radius_gauge.scad
5054
-D 'FLIP=true' \
5155
-D 'TYPE="convex"' \
5256
-D 'TAB=true' \
57+
-D 'ROTATE_TEXT=true' \
5358
-D 'BASE_WIDTH=34.9' \
5459
-D 'CHAMFER_WIDTH=2' \
5560
-D 'RADIUS=$*' \
5661
$< 2>&1 | tee /dev/stderr | grep -qP 'Objects:\s+2'
62+
63+
stls/remix_bottom.3mf: bottom.scad
64+
@mkdir ./stls/ 2>/dev/null || true
65+
$(OPENSCAD) -o $@ $< 2>&1

bottom.scad

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
use <overpass-extrabold.ttf>;
2+
3+
NUM = 30;
4+
5+
BASE_WALL_THICKNESS=2.6;
6+
SLOT_DEPTH=35.55;
7+
SLOT_WIDTH=2.35;
8+
SLOT_HEIGHT=8;
9+
SLOT_WALL=0.85;
10+
11+
FUDGE=0.0001;
12+
13+
SLOTS_WIDTH = NUM*SLOT_WIDTH + (NUM-1)*SLOT_WALL;
14+
BASE_WIDTH=SLOTS_WIDTH+4.92501*2;
15+
SLOTS_DEPTH = SLOT_DEPTH;
16+
BASE_DEPTH=SLOTS_DEPTH+4.72500*2;
17+
18+
WITH_CUTOUT=false;
19+
20+
21+
difference() {
22+
union() {
23+
translate([0, BASE_DEPTH, 0.5]) rotate([180, 0, 0]) 3d_chamfer(BASE_WIDTH, BASE_DEPTH, 2.82843, BASE_WIDTH-1, BASE_DEPTH-1, 2.41421, 0.5);
24+
25+
translate([0, 0, 0.5]) linear_extrude(height = 4.5) 2d_chamfer(BASE_WIDTH, BASE_DEPTH, sqrt(pow(2.82843, 2)/2));
26+
27+
translate([BASE_WALL_THICKNESS, BASE_WALL_THICKNESS, 0.5+4.5]) linear_extrude(height = 4.6) 2d_chamfer(BASE_WIDTH-2*BASE_WALL_THICKNESS, BASE_DEPTH-2*BASE_WALL_THICKNESS, sqrt(pow(2.74559, 2)/2));
28+
translate([BASE_WALL_THICKNESS, BASE_WALL_THICKNESS, 5+4.6]) 3d_chamfer(BASE_WIDTH-2*BASE_WALL_THICKNESS, BASE_DEPTH-2*BASE_WALL_THICKNESS, 2.75, BASE_WIDTH-2*BASE_WALL_THICKNESS-0.8,BASE_DEPTH-2*BASE_WALL_THICKNESS-0.8, 2.41421, 0.4);
29+
};
30+
slots();
31+
};
32+
33+
module slots() {
34+
for(i = [0 : NUM-1]) {
35+
translate([4.92500+i*(SLOT_WIDTH+SLOT_WALL), 4.72500, 10-SLOT_HEIGHT]) slot();
36+
}
37+
}
38+
39+
module slot() {
40+
if(WITH_CUTOUT) {
41+
union() {
42+
cube([SLOT_WIDTH, SLOT_DEPTH+2.125, SLOT_HEIGHT]);
43+
translate([0, SLOT_DEPTH+2.125, 0]) rotate([45, 0, 0]) cube([SLOT_WIDTH, 1, 1]);
44+
translate([0, SLOT_DEPTH+2.125, sqrt(2)/2]) cube([SLOT_WIDTH, sqrt(2)/2, SLOT_HEIGHT-sqrt(2)/2]);
45+
}
46+
} else {
47+
difference() {
48+
cube([SLOT_WIDTH, SLOT_DEPTH+2.125, SLOT_HEIGHT]);
49+
translate([0, SLOT_DEPTH+2.125, -sqrt(2)/2]) rotate([45, 0, 0]) cube([SLOT_WIDTH, 1, 1]);
50+
}
51+
}
52+
}
53+
54+
55+
56+
57+
module 3d_chamfer(bottomW, bottomD, bottomSideChamfer, topW, topD, topSideChamfer, height) {
58+
hull() {
59+
linear_extrude(height = FUDGE) 2d_chamfer(bottomW, bottomD, sqrt(pow(bottomSideChamfer, 2)/2));
60+
translate([(topW/bottomW)/2, (topD/bottomD)/2, height-FUDGE]) linear_extrude(height = FUDGE) 2d_chamfer(topW, topD, sqrt(pow(topSideChamfer, 2)/2));
61+
}
62+
}
63+
64+
module 2d_chamfer(bottomW, bottomD, radius) {
65+
polygon([
66+
[radius, 0],
67+
[0, radius],
68+
[0, bottomD-radius],
69+
[radius, bottomD],
70+
[bottomW-radius, bottomD],
71+
[bottomW, bottomD-radius],
72+
[bottomW, radius],
73+
[bottomW-radius, 0]
74+
]);
75+
}
76+
77+

radius_gauge.scad

+13-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ TYPE="concave"; // Overwrite with -D TYPE=convex
66
FLIP=false;
77
BASE_WIDTH=34.9;
88
CHAMFER_WIDTH=2;
9+
ROTATE_TEXT=true;
910

1011
if(TYPE == "concave") {
1112
rotate([0,FLIP ? 180 : 0,0]) gauge_concave(BASE_WIDTH, RADIUS, CHAMFER_WIDTH, TAB);
@@ -21,7 +22,11 @@ module gauge_concave(baseWidth, radius, chamferWidth, tab) {
2122
difference() {
2223
base(baseWidth, chamferWidth, tab);
2324
translate([0, baseWidth, 1]) cylinder(h = 2, r = radius, center = true, $fn = 1000);
24-
translate([baseWidth-2, 4, 1.7]) linear_extrude(0.3) radius_text(baseWidth, radius);
25+
if(ROTATE_TEXT) {
26+
translate([baseWidth-2, 4, 1.7]) linear_extrude(0.3) rotate([0, 0, 90]) radius_text(baseWidth, radius, halign="left");
27+
} else {
28+
translate([baseWidth-2, 4, 1.7]) linear_extrude(0.3) radius_text(baseWidth, radius);
29+
}
2530
};
2631
};
2732

@@ -40,8 +45,8 @@ module gauge_convex(baseWidth, radius, chamferWidth, tab) {
4045
};
4146

4247

43-
module radius_text(baseWidth, radius) {
44-
text(padded_str(radius), size = 6, font = "Overpass:style=ExtraBold", halign = "right", $fn = 1000);
48+
module radius_text(baseWidth, radius, halign = "right") {
49+
text(padded_str(radius), size = 6, font = "Overpass:style=ExtraBold", halign = halign, $fn = 1000);
4550
}
4651

4752
module base(baseWidth, chamferWidth, withTab) {
@@ -77,6 +82,10 @@ function leftpad(num, digits) = num >= pow(10, digits-1) ? str(num) : str("0", l
7782

7883

7984
module module_text(baseWidth, r) {
80-
color("red") translate([baseWidth-2, 4, 1.701]) linear_extrude(0.3) radius_text(baseWidth, r);
85+
if(ROTATE_TEXT) {
86+
color("red") translate([baseWidth-2, 4, 1.701]) rotate([0, 0, 90]) linear_extrude(0.3) radius_text(baseWidth, r, halign="left");
87+
} else {
88+
color("red") translate([baseWidth-2, 4, 1.701]) linear_extrude(0.3) radius_text(baseWidth, r);
89+
}
8190
}
8291

0 commit comments

Comments
 (0)