-
Notifications
You must be signed in to change notification settings - Fork 0
/
kleinteilregal.scad
143 lines (117 loc) · 3.84 KB
/
kleinteilregal.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
// This attempts to be a "Gewürzregal" (spice rack).
// I will try to only use one 4mm thick 30x60cm MDF board.
// Size of common spice containers (germany):
// Leng | Heig | Name
// 43 81 "Ostmann" small white cylindrical
// 56 78 "Fuchs" big white cylindrical
// 68 115 "HOREKA" smallish transparent (200ml?)
// 70 80 "Rinderbrühe" glass cylindrical
// dimensions of raw board
width = 595;
height = 295;
thickness = 4.22;
board_depth = 90;
bar_offset = 7;
bar_height = 10;
//bpos = [5, 120, height - thickness - 5];
bpos = [5, 115, 265];
board_side_tcount = 4;
board_back_tcount = 4;
side_back_tcount = 20;
// calculate the size of the sideback pieces
used = board_depth * 5 + bar_height * len(bpos);
sb_size = (width - used) / 2;
module teeth(length, depth, count, start = 0) {
size = length / count;
for (i = [start:2:count])
translate([i*size-0.001, -0.001, 0])
square([size+0.002, depth+0.002]);
}
module board() {
difference() {
square([height, board_depth]);
// intersection with side piece
translate([thickness, thickness, 0]) rotate([0, 0, 90])
teeth(board_depth-thickness, thickness, board_side_tcount);
translate([height, thickness, 0]) rotate([0, 0, 90])
teeth(board_depth-thickness, thickness, board_side_tcount);
// intersection with sideback piece
translate([thickness, 0, 0])
teeth(sb_size-thickness, thickness, board_back_tcount);
translate([height-thickness, thickness, 0]) rotate([0, 0, 180])
teeth(sb_size-thickness, thickness, board_back_tcount);
// remove small part used for intersection of side and sideback
translate([0, 0, 0])
square([thickness, thickness]);
translate([height-thickness, 0, 0])
square([thickness, thickness]);
}
}
module side() {
difference() {
square([height, board_depth]);
teeth(height, thickness, side_back_tcount);
for (bp = bpos) {
translate([thickness+bp, thickness, 0]) rotate([0, 0, 90])
teeth(board_depth-thickness, thickness, board_side_tcount, 1);
translate([bp+thickness+bar_offset, board_depth-thickness, 0])
square([bar_height, thickness]);
}
}
}
module sideback() {
difference() {
square([height, sb_size]);
teeth(height, thickness, side_back_tcount, 1);
// intersections with boards
for (bp = bpos)
translate([thickness+bp, thickness, 0]) rotate([0, 0, 90])
teeth(sb_size-thickness, thickness, board_back_tcount, 1);
// mounting holes
for (i = [25:20:height])
translate([i, sb_size*2/3, 0]) circle(d = 5, $fn = 64);
}
}
module bar() {
square([height, bar_height]);
}
module overlap() {
for (i = [0:$children-1]) {
intersection() {
union() for (j = [0:$children-1])
if (i != j) children(j);
children(i);
}
}
}
union() {
for (bp = bpos)
translate([0, 0, bp]) linear_extrude(thickness) board();
for (bp = bpos)
translate([0, board_depth, bp+thickness+bar_offset])
rotate([90, 0, 0]) linear_extrude(thickness) bar();
translate([thickness, 0, 0]) rotate([0, 270, 0])
linear_extrude(thickness) side();
translate([height, 0, 0]) rotate([0, 270, 0])
linear_extrude(thickness) side();
rotate([270, 270, 0])
linear_extrude(thickness) sideback();
translate([height, thickness, 0]) rotate([90, 270, 0])
linear_extrude(thickness) sideback();
}
%translate([50, 50, bpos[0]+thickness+0.1]) cylinder(78, r=56/2);
%translate([50, 10, bpos[1]+thickness+0.1]) cube([68, 68, 115]);
*union() {
for (i = [0:len(bpos)-1])
translate([0, i*(board_depth+0.001), 0]) board();
offset1 = len(bpos) * (board_depth+0.001);
for (i = [0:1])
translate([0, offset1 + i*(board_depth+0.001), 0]) side();
offset2 = offset1 + 2 * (board_depth+0.001);
for (i = [0:1])
translate([0, offset2 + i*(sb_size+0.001), 0]) sideback();
offset3 = offset2 + 2 * (sb_size+0.001);
for (i = [0:len(bpos)-1])
translate([0, offset3 + i*(bar_height+0.001), 0]) bar();
offset4 = offset3 + len(bpos) * (bar_height+0.001);
}