|
@@ -0,0 +1,245 @@
|
|
1
|
+resolution = 20; //[10, 20, 30, 50, 100]
|
|
2
|
+$fn = resolution;
|
|
3
|
+
|
|
4
|
+show_frame = false; // [true, false]
|
|
5
|
+show_pico = true; // [true, false]
|
|
6
|
+show_lid = false; // [true, false]
|
|
7
|
+show_button = false; // [true, false]
|
|
8
|
+
|
|
9
|
+module rounded_plate(w, h, t, d) {
|
|
10
|
+ translate([0, (d/2), 0])
|
|
11
|
+ cube([w, (h-d), t]);
|
|
12
|
+ translate([(d/2), 0, 0])
|
|
13
|
+ cube([(w-d), h, t]);
|
|
14
|
+ translate([(d/2), (d/2), 0])
|
|
15
|
+ cylinder(h=t, d=d);
|
|
16
|
+ translate([w-(d/2), (d/2), 0])
|
|
17
|
+ cylinder(h=t, d=d);
|
|
18
|
+ translate([(d/2), h-(d/2), 0])
|
|
19
|
+ cylinder(h=t, d=d);
|
|
20
|
+ translate([w-(d/2), h-(d/2), 0])
|
|
21
|
+ cylinder(h=t, d=d);
|
|
22
|
+}
|
|
23
|
+
|
|
24
|
+module usb_port() {
|
|
25
|
+ translate([0.3, 0, 0])
|
|
26
|
+ color("grey")
|
|
27
|
+ difference() {
|
|
28
|
+ union() {
|
|
29
|
+ cube([7.4, 6, 2.7]);
|
|
30
|
+ translate([-0.3, 5.4, -0.1])
|
|
31
|
+ cube([8, 0.6, 2.9]);
|
|
32
|
+ }
|
|
33
|
+ }
|
|
34
|
+}
|
|
35
|
+
|
|
36
|
+module switch() {
|
|
37
|
+ color("grey")
|
|
38
|
+ cube([3.5, 4.5, 1]);
|
|
39
|
+ color("white")
|
|
40
|
+ translate([(3.5/2), (4.5/2), 0])
|
|
41
|
+ cylinder(h=1.5, d=3);
|
|
42
|
+}
|
|
43
|
+
|
|
44
|
+p_w = 21;
|
|
45
|
+p_h = 51;
|
|
46
|
+p_t = 1.0;
|
|
47
|
+os = 0.35;
|
|
48
|
+b = 2;
|
|
49
|
+
|
|
50
|
+module pico() {
|
|
51
|
+ translate([((p_w-8)/2), ((p_h+1.3)-6), p_t])
|
|
52
|
+ usb_port();
|
|
53
|
+
|
|
54
|
+ translate([5.25, 36.6, 0.6])
|
|
55
|
+ switch();
|
|
56
|
+
|
|
57
|
+ difference() {
|
|
58
|
+ color("green")
|
|
59
|
+ cube([p_w, p_h, 1]);
|
|
60
|
+
|
|
61
|
+ translate([((p_w/2)-5.7), 2, -0.01])
|
|
62
|
+ cylinder(h=p_t+0.02, d=2.1);
|
|
63
|
+
|
|
64
|
+ translate([(p_w-((p_w/2)-5.7)), 2, -0.01])
|
|
65
|
+ cylinder(h=p_t+0.02, d=2.1);
|
|
66
|
+
|
|
67
|
+ translate([((p_w/2)-5.7), (p_h-2), -0.01])
|
|
68
|
+ cylinder(h=p_t+0.02, d=2.1);
|
|
69
|
+
|
|
70
|
+ translate([(p_w-((p_w/2)-5.7)), (p_h-2), -0.01])
|
|
71
|
+ cylinder(h=p_t+0.02, d=2.1);
|
|
72
|
+ }
|
|
73
|
+}
|
|
74
|
+
|
|
75
|
+if (show_pico) {
|
|
76
|
+ translate([(os+b), (os+b), 3.4])
|
|
77
|
+ pico();
|
|
78
|
+}
|
|
79
|
+
|
|
80
|
+if (show_frame) {
|
|
81
|
+ union() {
|
|
82
|
+ difference() {
|
|
83
|
+ // Outer frame
|
|
84
|
+ rounded_plate(p_w+(2*(os+b)), p_h+(2*(os+b)), 10, (2*(os+b)));
|
|
85
|
+
|
|
86
|
+ // Board cut-out
|
|
87
|
+ translate([b, b, -1])
|
|
88
|
+ cube([p_w+(2*os), p_h+(2*os), 12]);
|
|
89
|
+
|
|
90
|
+ // USB port cut-out
|
|
91
|
+// translate([b+os+((p_w-10)/2), b+os+((p_h+1)-6), 3.4])
|
|
92
|
+// cube([10, 8, 4.7]);
|
|
93
|
+ translate([b+os+((p_w-10)/2), b+(2*os)+p_h-1, 8.1])
|
|
94
|
+ rotate([-90, 0, 0])
|
|
95
|
+ rounded_plate(10, 4.7, 4.7, 2);
|
|
96
|
+
|
|
97
|
+ // Lid release cut-out
|
|
98
|
+ difference() {
|
|
99
|
+ union() {
|
|
100
|
+ translate([b+os+((p_w-10)/2), -1, 10-1])
|
|
101
|
+ cube([10, 8, 2]);
|
|
102
|
+ translate([b+os+((p_w-6)/2), -1, 10-1])
|
|
103
|
+ rotate([-90, 0, 0])
|
|
104
|
+ cylinder(h=4, d=2);
|
|
105
|
+ translate([b+os+((p_w-6)/2), -1, 10-2])
|
|
106
|
+ cube([6, 8, 3]);
|
|
107
|
+ translate([b+os+((p_w+6)/2), -1, 10-1])
|
|
108
|
+ rotate([-90, 0, 0])
|
|
109
|
+ cylinder(h=4, d=2);
|
|
110
|
+ }
|
|
111
|
+ translate([b+os+((p_w+10)/2), -1, 10-1])
|
|
112
|
+ rotate([-90, 0, 0])
|
|
113
|
+ cylinder(h=4, d=2);
|
|
114
|
+ translate([b+os+((p_w-10)/2), -1, 10-1])
|
|
115
|
+ rotate([-90, 0, 0])
|
|
116
|
+ cylinder(h=4, d=2);
|
|
117
|
+ }
|
|
118
|
+
|
|
119
|
+ // Outer frame
|
|
120
|
+ translate([1, 1, 10-1.2])
|
|
121
|
+ rounded_plate(p_w+(2*(os+b))-2, p_h+(2*(os+b))-2, 2, (2*(os+b))-2);
|
|
122
|
+
|
|
123
|
+ // Left top retainer cut-out
|
|
124
|
+ translate([b+os+(p_w/2)-(3.2/2)-7.1, b+p_h+(2*os), 10-3+0.2])
|
|
125
|
+ cube([3.2, 0.7, 1.0]);
|
|
126
|
+
|
|
127
|
+ // Right top retainer cut-out
|
|
128
|
+ translate([b+os+(p_w/2)-(3.2/2)+7.1, b+p_h+(2*os), 10-3+0.2])
|
|
129
|
+ cube([3.2, 0.7, 1.0]);
|
|
130
|
+
|
|
131
|
+ // Left bottom retainer cut-out
|
|
132
|
+ translate([b+os+(p_w/2)-(4/2)-7.1, b+os-0.7, 10-3+0.2])
|
|
133
|
+ cube([4, 0.7, 1.0]);
|
|
134
|
+
|
|
135
|
+ // Right bottom retainer cut-out
|
|
136
|
+ translate([b+os+(p_w/2)-(4/2)+7.1, b+os-0.7, 10-3+0.2])
|
|
137
|
+ cube([4, 0.7, 1.0]);
|
|
138
|
+
|
|
139
|
+ // Left retainer cut-out
|
|
140
|
+ translate([b-0.7, b+os+(p_h/2)-2, 10-3+0.2])
|
|
141
|
+ cube([0.7, 4, 1.0]);
|
|
142
|
+
|
|
143
|
+ // Right retainer cut-out
|
|
144
|
+ translate([b+(2*os)+p_w, b+os+(p_h/2)-2, 10-3+0.2])
|
|
145
|
+ cube([0.7, 4, 1.0]);
|
|
146
|
+ }
|
|
147
|
+
|
|
148
|
+ // Left support rail
|
|
149
|
+ translate([b+os+(p_w/2)-(3/2)-5.5, 0, 0])
|
|
150
|
+ cube([3, p_h+(2*(os+b)), 3.4]);
|
|
151
|
+
|
|
152
|
+ // Right support rail
|
|
153
|
+ translate([b+os+(p_w/2)-(3/2)+5.5, 0, 0])
|
|
154
|
+ cube([3, p_h+(2*(os+b)), 3.4]);
|
|
155
|
+
|
|
156
|
+ // Left top retainer
|
|
157
|
+ translate([b+os+(p_w/2)-(2.2/2)-6.1, b+p_h+(2*os)-0.6, 3.4+1+0.5])
|
|
158
|
+ cube([2.2, 0.6, 0.8]);
|
|
159
|
+
|
|
160
|
+ // Right top retainer
|
|
161
|
+ translate([b+os+(p_w/2)-(2.2/2)+6.1, b+p_h+(2*os)-0.6, 3.4+1+0.5])
|
|
162
|
+ cube([2.2, 0.6, 0.8]);
|
|
163
|
+
|
|
164
|
+ // Left bottom retainer
|
|
165
|
+ translate([b+os+(p_w/2)-(3/2)-5.7, b, 3.4+1+0.])
|
|
166
|
+ cube([3, 0.6, 0.8]);
|
|
167
|
+
|
|
168
|
+ // Right bottom retainer
|
|
169
|
+ translate([b+os+(p_w/2)-(3/2)+5.7, b, 3.4+1+0.5])
|
|
170
|
+ cube([3, 0.6, 0.8]);
|
|
171
|
+ }
|
|
172
|
+}
|
|
173
|
+
|
|
174
|
+if (show_lid) {
|
|
175
|
+ difference() {
|
|
176
|
+ union() {
|
|
177
|
+ translate([1+os, 1+os, 10-1.2])
|
|
178
|
+ rounded_plate(p_w+(2*b)-2, p_h+(2*b)-2, 1, (2*b)-2);
|
|
179
|
+ translate([(os+b), (os+b), 10-3])
|
|
180
|
+ rounded_plate(p_w, p_h, 2, (2*b)-3);
|
|
181
|
+
|
|
182
|
+ // Left top retainer
|
|
183
|
+ translate([b+os+(p_w/2)-(2.2/2)-7.1, b+p_h+os, 10-3+0.4])
|
|
184
|
+ cube([2.2, 0.6, 0.6]);
|
|
185
|
+
|
|
186
|
+ // Right top retainer
|
|
187
|
+ translate([b+os+(p_w/2)-(2.2/2)+7.1, b+p_h+os, 10-3+0.4])
|
|
188
|
+ cube([2.2, 0.6, 0.6]);
|
|
189
|
+
|
|
190
|
+ // Left bottom retainer
|
|
191
|
+ translate([b+os+(p_w/2)-(3/2)-7.1, b+os-0.5, 10-3+0.3])
|
|
192
|
+ cube([3, 0.6, 0.6]);
|
|
193
|
+
|
|
194
|
+ // Right bottom retainer
|
|
195
|
+ translate([b+os+(p_w/2)-(3/2)+7.1, b+os-0.5, 10-3+0.3])
|
|
196
|
+ cube([3, 0.6, 0.6]);
|
|
197
|
+
|
|
198
|
+ // Left retainer
|
|
199
|
+ translate([b+os-0.6, b+os+(p_h/2)-1.5, 10-3+0.3])
|
|
200
|
+ cube([0.6, 3, 0.6]);
|
|
201
|
+
|
|
202
|
+ // Right retainer
|
|
203
|
+ translate([b+os+p_w, b+os+(p_h/2)-1.5, 10-3+0.3])
|
|
204
|
+ cube([0.6, 3, 0.6]);
|
|
205
|
+ }
|
|
206
|
+
|
|
207
|
+ // USB port cut-out
|
|
208
|
+ translate([b+os+((p_w-10)/2), b+p_h+(2*os)-2, 10-4.2])
|
|
209
|
+ cube([10, 8, 2.4]);
|
|
210
|
+
|
|
211
|
+ // Lid release cut-out
|
|
212
|
+ translate([b+os+((p_w-10)/2), -1, 10-4.2])
|
|
213
|
+ cube([10, 8, 3]);
|
|
214
|
+
|
|
215
|
+ // Switch cut-out
|
|
216
|
+ translate([(os+b)+7, (os+b)+38.85, 0])
|
|
217
|
+ cylinder(h=10, d=5);
|
|
218
|
+
|
|
219
|
+ // Inset
|
|
220
|
+ translate([(os+b)+1, (os+b)+1, 10-4])
|
|
221
|
+ cube([p_w-2, p_h-2, 3]);
|
|
222
|
+ }
|
|
223
|
+ // Switch surround
|
|
224
|
+ translate([(os+b), (os+b)+38.85-6, 10-2])
|
|
225
|
+ cube([p_w, 1, 1]);
|
|
226
|
+
|
|
227
|
+ translate([(os+b), (os+b)+38.85+5, 10-2])
|
|
228
|
+ cube([p_w, 1, 1]);
|
|
229
|
+
|
|
230
|
+}
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+if (show_button) {
|
|
234
|
+ color("red")
|
|
235
|
+ union() {
|
|
236
|
+ translate([(os+b)+7, (os+b)+38.85, 7.5])
|
|
237
|
+ cylinder(h=2.3, d=4.4);
|
|
238
|
+ difference() {
|
|
239
|
+ translate([(os+b)+7, (os+b)+38.85, 6.5])
|
|
240
|
+ cylinder(h=2, d=7.6);
|
|
241
|
+ translate([(os+b)+7, (os+b)+38.85, 6.5])
|
|
242
|
+ cylinder(h=1, d=6.6);
|
|
243
|
+ }
|
|
244
|
+ }
|
|
245
|
+}
|