forked from JustinSDK/dotSCAD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tableware_organizer.scad
65 lines (52 loc) · 1.76 KB
/
tableware_organizer.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
use <polyline2d.scad>
use <util/fibseq.scad>;
smallest_length = 30;
height1 = 60;
height2 = 120;
thickness = 1;
module tableware_organizer(smallest_length, height1, height2, thickness) {
module golden_rectangle(fseq, i = 0) {
if(i < len(fseq) - 1) {
f1 = fseq[i] * smallest_length;
f2 = fseq[i + 1] * smallest_length;
linear_extrude(f1 < 3 * smallest_length ? height1 : height2)
polyline2d([[0, 0], [f1, 0], [f1, f1], [0, f1], [0, 0]], thickness);
linear_extrude(thickness)
square([f1, f1]);
translate([0, f1 - f2, 0])
rotate(90)
golden_rectangle(fseq, i + 1);
}
}
p1 = smallest_length * 3 / 4;
p2 = smallest_length / 4;
double_thickness = thickness * 2;
ex_h = smallest_length * 8;
angles = [90, 90, 0];
module slash(pts) {
rotate(angles)
linear_extrude(ex_h, center = true)
polyline2d(pts, double_thickness);
}
module slash_diffs1() {
x = smallest_length * 2.5;
pts = [[-p1, -p1], [p1, p1]];
for(h = [height2 / 2, height2 / 3, height2 / 1.5]) {
translate([x, 0, h]) slash(pts);
}
}
module slash_diffs2() {
x = smallest_length * 0.5;
pts = [[-p2, -p2], [p2, p2]];
for(h = [height1 / 3, height1 / 1.5]) {
translate([x, 0, h]) slash(pts);
translate([-x, 0, h]) slash(pts);
}
}
difference() {
golden_rectangle(fibseq(1, 5));
slash_diffs1();
slash_diffs2();
}
}
tableware_organizer(smallest_length, height1, height2, thickness);