forked from eclecticc/ParametricCase
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mini-itx.scad
368 lines (305 loc) · 15.6 KB
/
mini-itx.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
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
// Parametric Mini-ITX Case
// https://github.com/eclecticc/ParametricCase
//
// BSD 2-Clause License
// Copyright (c) 2018, Nirav Patel, http://eclecti.cc
//
// The main file with the case itself
include <defaults.scad>;
include <pci_bracket.scad>;
include <fan.scad>;
include <vent.scad>;
include <psu.scad>;
include <heatsink.scad>;
include <gpu.scad>;
include <motherboard.scad>;
include <power_switch.scad>;
include <front_panel.scad>;
// Uxcell M3 threaded inserts from Amazon
insert_r = 5.3/2+0.1;
insert_h = 5.0;
module motherboard_standoff() {
difference() {
cylinder(r = (0.4*25.4)/2, h = miniitx_bottom_keepout);
translate([0, 0, miniitx_bottom_keepout-insert_h]) cylinder(r = insert_r - 0.1, h = insert_h+extra);
}
}
module motherboard_standoffs_miniitx() {
$fn = 50;
// Mounting holes for the motherboard
translate([miniitx_hole_c[0], miniitx_hole_c[1], 0]) {
motherboard_standoff();
for (hole = [miniitx_hole_f, miniitx_hole_h, miniitx_hole_j]) {
translate([hole[0], hole[1], 0]) motherboard_standoff();
}
}
}
// Just a little wedge to provide support for the PSU
module psu_ledge() {
cube_size = 15;
translate([0, extra, 0]) difference() {
translate([-cube_size/2, 0, 0]) rotate([-45, 0, 0]) cube([cube_size, cube_size, cube_size], true);
translate([-cube_size*1.5, -cube_size*1.5, 0]) cube([cube_size*2, cube_size*2, cube_size*2]);
translate([-cube_size*1.5, 0, -cube_size*1.5]) cube([cube_size*2, cube_size*2, cube_size*2]);
}
}
module psu_corner_ledge() {
cube_size = 25;
translate([-extra, -extra, 0]) difference() {
translate([-cube_size/5, -cube_size/5, 0]) rotate([0, 0, -45]) rotate([45, 0, 0]) cube([cube_size, cube_size, cube_size], true);
translate([-cube_size*1.1, -cube_size*1.1, 0]) cube([cube_size*2, cube_size*2, cube_size*2]);
translate([-cube_size*2, -cube_size*1.1, -cube_size]) cube([cube_size*2, cube_size*2, cube_size*2]);
translate([-cube_size*1.1, -cube_size*2, -cube_size]) cube([cube_size*2, cube_size*2, cube_size*2]);
}
}
module cable_wrap_holder() {
wrap_width = 15;
difference () {
translate([wall, -wall-wrap_width/2, 0]) {
cube([wall, wall*2+wrap_width, wall*2]);
translate([-wall*1.5, 0, 0]) cube([wall*2, wall, wall*2]);
translate([-wall*1.5, wall+wrap_width, 0]) cube([wall*2, wall, wall*2]);
translate([wall, 0, 0]) rotate([0, -45-90, 0]) cube([wall*2, wall, wall*4]);
translate([wall, wall+wrap_width, 0]) rotate([0, -45-90, 0]) cube([wall*2, wall, wall*4]);
}
translate([-wall/2-10, -wall-wrap_width, -10]) cube([10, wrap_width*2+wall*2, 20]);
}
}
// The tab that the pci bracket screws into
module pci_bracket_holder() {
tab_depth = 11.43;
bottom_wall = 1.0;
translate(pci_e_to_bracket) {
difference() {
// The body of the tab
translate([pci_bracket_back_edge, -pci_e_spacing+pci_bracket_right_edge-pci_bracket_slot_extra, -tab_depth]) cube([tab_depth, pci_e_spacing+pci_bracket_total_width+pci_bracket_slot_extra*2-2.54, tab_depth]);
// Chop it at 45 degrees to make it printable
translate([pci_bracket_back_edge+tab_depth, -pci_e_spacing+pci_bracket_right_edge-pci_bracket_slot_extra-extra/2, -tab_depth]) rotate([0, -45-90, 0]) cube([tab_depth*2, pci_e_spacing+pci_bracket_total_width+pci_bracket_slot_extra*2-2.54+extra, tab_depth]);
}
}
}
module pci_bracket_holder_cutout() {
$fn = 20;
bottom_wall = 1.0;
translate(pci_e_to_bracket) {
// Cut out the holes for the threaded insert and the bolt
translate([0, 0, -insert_h]) {
cylinder(r = insert_r - 0.1, h = insert_h+extra);
translate([0, 0, -bottom_wall-extra/2]) cylinder(r = 1.5, h = bottom_wall+extra);
}
translate([0, -pci_e_spacing, -insert_h]) {
cylinder(r = insert_r - 0.1, h = insert_h+extra);
translate([0, 0, -bottom_wall-extra/2]) cylinder(r = 1.5, h = bottom_wall+extra);
}
}
}
module top_lid(size) {
cube([size[0], size[1], wall]);
translate([0, 0, wall/2]) rotate([45, 0, 0]) translate([0, -wall/4, -wall/4]) cube([size[0], wall/2, wall/2]);
translate([0, size[1], wall/2]) rotate([45, 0, 0]) translate([0, -wall/4, -wall/4]) cube([size[0], wall/2, wall/2]);
translate([size[0], 0, wall/2]) rotate([45, 0, 90]) translate([0, -wall/4, -wall/4]) cube([size[1], wall/2, wall/2]);
}
module back_to_back() {
motherboard_miniitx(false, am4_holes, am4_socket);
translate([am4_holes[0], am4_holes[1], am4_socket[2]+miniitx[2]]) cryorig_c7();
translate([0, miniitx[1]-flexatx_size[2], -miniitx_bottom_keepout-wall]) {
rotate([-90, 0, 0]) flexatx();
}
translate([pci_e_offset[0], pci_e_offset[1]+100, -40]) {
rotate([90, 0, 0]) zotac_1080_mini();
}
}
module traditional(show_body, show_lid, show_internals, heatsink_type, psu_type) {
// Airflow clearance for CPU fan
cpu_fan_clearance = 5;
heatsink_height = heatsink_height(heatsink_type);
psu_size = psu_size(psu_type);
// Extra height for cable clearance for 8-pin connectors on the top of the card
gpu_power_height = 5;
// FIXME: gpu thickness doesn't account for bracket width
gpu_location = [pci_e_offset[0], pci_e_offset[1], pci_e_offset[2]+miniitx[2]];
case_origin = [motherboard_back_edge-wall, -zotac_1080_thickness-wall+pci_e_offset[1]+3, -miniitx_bottom_keepout-wall]; // TODO: Clean up the Y calculation
m2_size = [110, 22+10];
m2_location = [miniitx[0]/2, 30]; // Note that this should be adjusted to match the mobo used
case_fan_size = 140;
case_fan_thickness = 25;
case_exhaust_fan_size = 80;
case_exhaust_fan_thickness = 15;
// Figure out the stacked heights of the tallest components to use for case height
psu_heatsink_stack = -case_origin[2]+miniitx[2]+am4_socket[2]+heatsink_height+cpu_fan_clearance+psu_size[2]+wall;
gpu_stack = -case_origin[2]+wall+pci_e_offset[2]+miniitx[2]+pci_e_cutout_height+zotac_1080_mini_pcb[1]+gpu_power_height;
// Figure out the stacked lengths of the longest components to use for case length
miniitx_cooling_length = -motherboard_back_edge+wall*3+miniitx[0]+(heatsink_type == "aio" ? corsair_h60_size[0] : case_fan_thickness);
gpu_length = zotac_1080_mini_length+wall*3; // Note the extra wall length for assembly margin
case_size = [max(miniitx_cooling_length, gpu_length), miniitx[1]-case_origin[1]+motherboard_back_panel_overhang+motherboard_back_panel_lip, max(psu_heatsink_stack, gpu_stack)];
psu_location = [motherboard_back_edge, case_origin[1]+case_size[1]-psu_size[1]-wall-wall/4, case_origin[2]+case_size[2]-psu_size[2]-wall];
cable_wrap_location = [psu_location[0] + psu_size[0] + (case_size[0] - psu_size[0])/3, case_origin[1]+case_size[1]-wall, case_origin[2]+case_size[2]-psu_size[2]-wall];
case_fan_location = [case_size[0]-wall-case_fan_thickness, (case_fan_size >= 120) ? case_size[1]/2-case_origin[1]/2 : case_size[1]/2, case_fan_size/2+wall*2];
case_exhaust_fan_location = [wall, case_size[1]-psu_size[1]-case_exhaust_fan_size/2-wall, case_size[2]-case_exhaust_fan_size/2-wall];
power_switch_location = [case_origin[0]+case_size[0], case_origin[1]+power_switch_r+wall*2.5, case_origin[2]+power_switch_r+wall*2.5];
dual_usb_location = [case_origin[0]+case_size[0]-wall, case_origin[1]+case_size[1]-wall-dual_usb_size[2]-0.5, case_origin[2]+case_size[2]/2];
// Calculate the case size in liters
case_volume = case_size[0]*case_size[1]*case_size[2]/1000000.0;
echo("Case dimensions X:", case_size[0], " Y:", case_size[1], " Z:", case_size[2], " L:", case_volume);
corsair_h60_location = [case_size[0]-wall-corsair_h60_size[0], case_size[1]-wall*2-corsair_h60_size[1], case_size[2]-wall*2-corsair_h60_size[2]];
// Using the bottom corner of the motherboard near the GPU as the origin
if (show_internals == true) {
motherboard_miniitx(true, am4_holes, am4_socket);
translate([am4_holes[0], am4_holes[1], am4_socket[2]+miniitx[2]]) {
heatsink_type(heatsink_type);
}
translate(psu_location) psu_type(psu_type);
if (psu_type == "flexatx") {
// The exhaust fan only fits (sort of) with flexatx
translate(case_origin) {
translate(case_exhaust_fan_location) {
rotate([0, 90, 0]) fan(case_exhaust_fan_size, case_exhaust_fan_thickness, 10);
}
}
}
translate(gpu_location) {
zotac_1080_mini();
}
translate(case_origin) {
// Put into place a radiator for AIO cooling
if (heatsink_type == "aio") {
translate(corsair_h60_location) {
corsair_h60();
}
} else {
// Otherwise put a standard case fan in the front
translate(case_fan_location) {
rotate([0, 90, 0]) fan(case_fan_size, case_fan_thickness, 10);
}
}
}
translate(power_switch_location) {
rotate([0, 90, 0]) power_switch();
}
translate(dual_usb_location) {
rotate([-90, 0, 0]) rotate([0, 0, 90]) dual_usb();
}
}
// Make the lid separately so it can be printed on its own
if (show_lid == true) color("WhiteSmoke", 0.5) {
translate(case_origin) {
translate([0, wall, case_size[2]-wall]) top_lid([case_size[0]-wall, case_size[1]-wall*2]);
}
}
// The actual case
if (show_body == true) color("WhiteSmoke", 0.5) {
// Motherboard standoffs taking threaded inserts
translate([0, 0, -miniitx_bottom_keepout]) {
motherboard_standoffs_miniitx();
}
// Part that the GPU screws into
translate(gpu_location) {
difference() {
pci_bracket_holder();
pci_bracket_holder_cutout();
}
}
// Attach ledges to the walls to help hold up the PSU
translate(psu_location) {
translate([psu_size[0], psu_size[1], 0]) psu_ledge();
translate([0, psu_size[1], 0]) rotate([0, 0, -90]) psu_corner_ledge();
}
// Put some cable wrap holders on the wall near the PSU
translate(cable_wrap_location) {
rotate([0, 0, -90]) {
cable_wrap_holder();
translate([0, 0, psu_size[2]-wall*4]) cable_wrap_holder();
}
}
difference() {
// Body of the case
translate(case_origin) {
difference() {
cube(case_size);
translate([wall, wall, wall]) cube([case_size[0]-wall*2, case_size[1]-wall*2, case_size[2]]);
minkowski() {
translate([0-extra, wall, case_size[2]-wall]) top_lid([case_size[0]-wall+extra, case_size[1]-wall*2]);
cube([0.2, 0.2, 0.2], center = true);
}
}
}
translate(case_origin) {
translate([8, 0.2, 8]) {
rotate([90, 0, 0]) linear_extrude(wall) {
text(str(case_volume), font = "Helvetica:style=Normal", size = 20);
}
}
}
motherboard_back_panel_cutout();
// Put a vent in the bottom for a typical M.2 SSD location.
translate([m2_location[0], m2_location[1], case_origin[2]]) vent_rectangular(m2_size, 10, 2.0);
// Put in a vent for the radiator for AIO cooling
if (heatsink_type == "aio") {
translate(case_origin) translate(corsair_h60_location) translate([corsair_h60_size[0]+wall, corsair_h60_size[1]/2-corsair_h60_fan_offset, corsair_h60_fan[0]/2]) {
rotate([0, 90, 0]) {
fan_cutout(corsair_h60_fan[0]);
}
}
} else {
// Otherwise put in a regular case fan vent
translate(case_origin) translate([case_fan_location[0]+case_fan_thickness+wall, case_fan_location[1], case_fan_location[2]]) {
rotate([0, 90, 0]) {
fan_cutout(case_fan_size);
}
}
}
if (psu_type == "sfx" || psu_type == "sfx_l") {
translate(psu_location) {
sfx_cutout();
}
// Put in vents on the back wall to improve airflow
back_panel_vent_v = [sfx_size[2], case_size[1]-zotac_1080_thickness-sfx_size[1]-wall*3];
translate(psu_location) translate([0, -back_panel_vent_v[1]/2+wall, back_panel_vent_v[0]/2-wall]) {
rotate([0, 90, 0]) vent_rectangular(back_panel_vent_v, 10, 2.0);
}
back_panel_vent_h = [case_size[2]-sfx_size[2]-wall*3-motherboard_back_panel_size[1]-miniitx_bottom_keepout, case_size[1]-zotac_1080_thickness-wall*2];
translate(psu_location) translate([0, sfx_size[1]-back_panel_vent_h[1]/2+wall, -back_panel_vent_h[0]/2]) {
rotate([0, 90, 0]) vent_rectangular(back_panel_vent_h, 10, 2.0);
}
} else {
translate(psu_location) {
flexatx_cutout(true);
}
translate(case_origin) translate([case_exhaust_fan_location[0]-wall, case_exhaust_fan_location[1], case_exhaust_fan_location[2]]) {
rotate([0, -90, 0]) {
fan_cutout(case_exhaust_fan_size);
}
}
}
translate(gpu_location) {
zotac_1080_mini_cutout();
pci_bracket_holder_cutout();
}
translate(power_switch_location) {
rotate([0, 90, 0]) power_switch_cutout();
}
translate(dual_usb_location) {
rotate([-90, 0, 0]) rotate([0, 0, 90]) dual_usb_cutout();
}
// Prevent corner lift by angling the bottom corners
translate(case_origin) {
rotate([0, 0, -45]) rotate([45, 0, 0]) cube([wall*3, wall*2, wall*2], center = true);
translate([case_size[0], 0, 0]) rotate([0, 0, 45]) rotate([45, 0, 0]) cube([wall*3, wall*2, wall*2], center = true);
translate([case_size[0], case_size[1], 0]) rotate([0, 0, 135]) rotate([45, 0, 0]) cube([wall*3, wall*2, wall*2], center = true);
translate([0, case_size[1], 0]) rotate([0, 0, -135]) rotate([45, 0, 0]) cube([wall*3, wall*2, wall*2], center = true);
}
}
}
}
module traditional_tower_cooler() {
motherboard_miniitx(false, am4_holes, am4_socket);
translate([am4_holes[0], am4_holes[1], am4_socket[2]+miniitx[2]]) noctua_nh_u9s();
translate([0, miniitx[1]-flexatx_size[2], flexatx_size[1]+miniitx[2]+45]) rotate([-90, 0, 0]) {
flexatx();
}
translate([pci_e_offset[0], pci_e_offset[1], pci_e_offset[2]+miniitx[2]]) {
zotac_1080_mini();
}
}
traditional(show_body = true, show_lid = false, show_internals = false, heatsink_type = "noctua_nh_l12s", psu_type = "sfx");
//traditional(show_body = true, show_lid = false, show_internals = true, heatsink_type = "aio", psu_type = "sfx");