forked from ejans/GH60-Case
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GH60 Case.scad
277 lines (234 loc) · 7.02 KB
/
GH60 Case.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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
use <MCAD/boxes.scad>
use <../snappy-reprap/joiners.scad>
$fa = 1;
$fs = 1;
//$fa = .1;
//$fs = .1;
ori_width_ext = 105;
ori_depth_ext = 295;
ori_width_int = 95;
ori_depth_int = 285;
tol = 1.5;
width_ext = 105 + tol;
depth_ext = 295 + tol;
height_ext = 15.6;
width_int = 95 + tol;
depth_int = 285 + tol;
height_int = 10.6;
fillet1=5;
fillet2=3;
stud_b = 3.8;
stud_b_wide = 9.8;
stud_r = 3.5;
stud_h = 4;
sstud_width = 3;
sstud2_width = 2;
round_stud_r = 3;
hole_r = .8;
combo();
//!case_joiners_left();
//!case_joiners_right();
module combo() {
case_joiners_left();
translate([0, -15, 0])
case_joiners_right();
}
module case_joiners_left() {
difference() {
case_left();
width = width_ext;
translate([-width/2,0,-7.8])cube([width, 10, 5]);
translate([(width/2) -5,0,-5])cube([10, 5, 20]);
translate([-((width/2) +5),0,-5])cube([10, 5, 20]);
}
translate([(width_ext/4), 0, -5.3])
rotate([0,90,180])
joiner(h=width_ext/2, w=5, l=10, a=30);
translate([-(width_ext/4), 0, -5.3])
rotate([0,90,180])
joiner(h=width_ext/2, w=5, l=10, a=30);
translate([-((width_ext/2)-2.5), 0, 2.5])
rotate([0, 0, 180])
half_joiner2(h=height_int, w=5, l=5, a=30);
translate([+((width_ext/2)-2.5), 0, 2.5])
rotate([0, 0, 180])
half_joiner(h=height_int, w=5, l=5, a=30);
}
module case_joiners_right() {
difference() {
case_right();
width = width_ext;
translate([-width/2,-10,-7.8])cube([width, 10, 5]);
translate([(width/2) -5,-5,-5])cube([10, 5, 20]);
translate([-(width/2) -5,-5,-5])cube([10, 5, 20]);
}
translate([(width_ext/4), 0, -5.3])
rotate([180,90,180])
joiner(h=width_ext/2, w=5, l=10, a=30);
translate([-(width_ext/4), 0, -5.3])
rotate([180,90,180])
joiner(h=width_ext/2, w=5, l=10, a=30);
translate([-((width_ext/2)-2.5), 0, 2.5])
rotate([0, 0, 0])
half_joiner(h=height_int, w=5, l=5, a=30);
translate([+((width_ext/2)-2.5), 0, 2.5])
rotate([0, 0, 0])
half_joiner2(h=height_int, w=5, l=5, a=30);
}
module case_left() {
difference() {
case();
// Right part
//translate([-250, 0, -250])
// Left part
translate([-250, -500, -250])
cube([500, 500, 500]);
}
}
module case_right() {
difference() {
case();
// Right part
translate([-250, 0, -250])
cube([500, 500, 500]);
}
}
module case() {
difference() {
bak_complete();
roundening(fillet1, height_ext, (width_ext/2) - fillet1, (depth_ext/2) - fillet1, 0);
roundening(fillet1, height_ext, -(width_ext/2) +fillet1, (depth_ext/2) - fillet1, 90);
roundening(fillet1, height_ext, (width_ext/2) -fillet1, -(depth_ext/2) + fillet1, -90);
roundening(fillet1, height_ext, -(width_ext/2) +fillet1, -(depth_ext/2) + fillet1, -180);
}
studs();
circlestuds();
squarestuds();
}
module bak_complete() {
difference() {
bak();
translate([(ori_width_int/2) + ((ori_width_ext - ori_width_int)/2),(ori_depth_int/2)-18.2,0])
//cube([(width_ext-width_int), 9, 6], center=true);
cube([(width_ext-width_int + 20), 11, 8], center=true);
translate([-0.7, (ori_depth_int/2) - 29.15, -5])
cylinder(h=10, r=2, center=true);
holes();
}
}
module bak() {
difference() {
//translate([0, 0, -height_ext/2])
//roundedRect([width_ext, depth_ext, height_ext], fillet1, center=true);
cube([width_ext, depth_ext, height_ext], center=true);
translate([0, 0, (height_ext - height_int)/2])
cube([width_int, depth_int, height_int], center=true);
}
}
module studs() {
translate([-9, (stud_b/2)-ori_depth_int/2, -1])
rotate([0,0,90])
stud(stud_b, stud_r, stud_h);
translate([-9, -((stud_b/2)-ori_depth_int/2), -1])
rotate([0,0,-90])
stud(stud_b, stud_r, stud_h);
translate([-((ori_width_int/2) - (stud_b_wide/2)), -48, -1])
stud(stud_b_wide, stud_r, stud_h);
}
module circlestuds() {
translate([19.6, -117.55, -1])
round_stud(round_stud_r, stud_h);
translate([19.6, 117.3, -1])
round_stud(round_stud_r, stud_h);
translate([0.5, 14.3, -1])
round_stud(round_stud_r, stud_h);
}
module holes() {
translate([19.6, -117.55, -1])
cylinder(h=50, r=hole_r, center=true);
translate([19.6, 117.3, -1])
cylinder(h=50, r=hole_r, center=true);
translate([0.5, 14.3, -1])
cylinder(h=50, r=hole_r, center=true);
translate([-9, (stud_b)-ori_depth_int/2, -1])
cylinder(h=50, r=hole_r, center=true);
translate([-9, -((stud_b)-ori_depth_int/2), -1])
cylinder(h=50, r=hole_r, center=true);
translate([-((ori_width_int/2) - (stud_b_wide)), -48, -1])
cylinder(h=50, r=hole_r, center=true);
}
module squarestuds() {
width_2 = ori_width_int/2;
depth_2 = ori_depth_int/2;
sqstd(64, 0, 0);
sqstd(62, 0, -88);
sqstd(82, 0, 0, ysign=-1);
sqstd2(18, 17.6, -12);
sqstd2(26, 17.6, -36);
sqstd2(85, 17.6, -90);
sqstd2(37, 17.6, 45, ysign=-1);
sqstd2(18, 17.6, 17, ysign=-1);
sqstd2(233, 17.6 + 19.3, -12);
sqstd2(15, 17.6 + 19.3, 15, ysign=-1);
sqstd2(265, 17.6 + 19.3 + 19.3, 20, ysign=-1);
sqstd2(240, 17.6 + 19.3 + 19.3 + 19.3, 45, ysign=-1);
sqstd2(17, 17.6 + 19.3 + 19.3 + 19.3, 10, ysign=-1);
}
module sqstd(b, x, y, xsign=+1, ysign=+1) {
width_2 = ori_width_int/2;
depth_2 = ori_depth_int/2;
translate([xsign * (-(width_2 - (sstud_width/2))) + x, ysign * ((depth_2 - (b/2)) + y), -1])
cube([sstud_width, b, stud_h], center=true);
}
module sqstd2(b, x, y, xsign=1, ysign=1) {
width_2 = ori_width_int/2;
depth_2 = ori_depth_int/2;
translate([xsign * (-(width_2 - (sstud2_width/2))) + x, ysign * (depth_2 - (b/2)) + y, -1])
cube([sstud2_width, b, stud_h], center=true);
}
module roundedRect(size, radius) {
x = size[0];
y = size[1];
z = size[2];
linear_extrude(height=z)
hull() {
// place 4 circles in the corners, with the given radius
translate([(-x/2)+(radius/2), (-y/2)+(radius/2), 0])
circle(r=radius);
translate([(x/2)-(radius/2), (-y/2)+(radius/2), 0])
circle(r=radius);
translate([(-x/2)+(radius/2), (y/2)-(radius/2), 0])
circle(r=radius);
translate([(x/2)-(radius/2), (y/2)-(radius/2), 0])
circle(r=radius);
}
}
module stud(b, r, h) {
// b = 3.8;
// r = 3.5;
// h = 4;
difference() {
union() {
cube([b, r*2, h], center=true);
translate([b/2, 0, 0])
cylinder(h=h, r=r, center=true);
}
translate([b/2, 0, 0])
cylinder(h=h, r=hole_r, center=true);
}
}
module round_stud(r, h) {
difference() {
cylinder(h=h, r=r, center=true);
cylinder(h=h, r=hole_r, center=true);
}
}
module roundening(r, h, x, y, rot) {
translate([x, y, 0])
rotate([0, 0, rot])
difference() {
translate([(r/2)+1, (r/2)+1, 0])
cube([r+2, r+2, h], center=true);
cylinder(h=h, r=r, center=true);
}
}