-
Notifications
You must be signed in to change notification settings - Fork 0
/
spicerack.scad
165 lines (131 loc) · 4.38 KB
/
spicerack.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
// New version.
// Vertical elements are now cut horizontally from the raw
// board. This way the racks height can differ from the raw
// boards height.
// 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
use <laser3d.scad>;
$play = 0.05;
// dimensions of raw board
width = 595;
height = 295;
thickness = 4.22;
board_count = 4;
rack_height = 420;
rack_depth = 70;
board_depth = 42;
board_offset = 105;
board_first = 5;
bar_offset = 7;
bar_height = 12;
bar_depth = 56 + 2*thickness + 3;
// teeth counts
board_side_tcount = 4;
board_back_tcount = 3;
side_back_tcount = 20;
sb_size = 50;
bpos = [for (i = [0:board_count-1]) i * board_offset + board_first];
module board() {
difference() {
square([height, board_depth-$play]);
// 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() {
sideShape();
teeth(rack_height, thickness, side_back_tcount);
for (bp = [for (i = [0:board_count-1]) i * board_offset + board_first]) {
translate([thickness+bp, thickness, 0]) rotate([0, 0, 90])
teeth(board_depth-thickness, thickness, board_side_tcount, 1);
translate([bp+thickness+bar_offset, bar_depth-thickness, 0])
square([bar_height, thickness]);
}
// remove safety hazard
translate([rack_height-29.7, 47])
square([50, 50]);
}
}
module sideback() {
difference() {
square([rack_height, sb_size]);
teeth(rack_height, thickness, side_back_tcount, 1);
// intersections with boards
for (bp = [for (i = [0:board_count-1]) i * board_offset + board_first])
translate([thickness+bp, thickness, 0]) rotate([0, 0, 90])
teeth(sb_size-thickness, thickness, board_back_tcount, 1);
// mounting holes
for (i = [25:20:rack_height])
translate([i, sb_size*2/3, 0]) circle(d = 5, $fn = 64);
}
}
module bar() {
square([height, bar_height-$play]);
}
module sideShape() {
length = rack_height;
period = rack_height / board_count;
phase = 12;
mean = 62;
amplitude = 15;
count = 100;
polygon(concat([[length, 0], [0, 0]], [for (i = [0:count])
[i / count * length,
mean + amplitude * sin(phase + i/count*length/period*360)
]]));
}
*union() {
for (bp = [for (i = [0:board_count-1]) i * board_offset + board_first])
translate([0, 0, bp]) linear_extrude(thickness) board();
for (bp = [for (i = [0:board_count-1]) i * board_offset + board_first])
translate([0, bar_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([150, 30, bpos[0]+thickness+0.1]) cylinder(78, r=56/2);
//%translate([50, 28, bpos[1]+thickness+0.1]) cylinder(81, r=43/2);
union() {
offset0 = 0;
offset1 = 0;
for (i = [0:board_count-1])
translate([0, offset1 + i * board_depth, 0]) board();
offset2 = offset1 + board_count * board_depth;
for (i = [1:board_count])
translate([i * bar_height, offset2, 0])
rotate([0, 0, 90]) bar();
offsetX = board_count * bar_height;
for (i = [1:2])
translate([offsetX + i*(sb_size+$play), offset2, 0])
rotate([0, 0, 90]) sideback();
translate([height, offset2, 0])
rotate([0, 0, 90]) side();
translate([height - 140, offset2 + rack_height, 0])
rotate([0, 0, -90]) side();
}