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
|
include <parameters.scad>
use <connector_back.scad>
use <connector_front.scad>
use <connector_pole.scad>
use <hdd.scad>
use <rail.scad>
use <backplane.scad>
module rand_color(base, seed1=0, seed2=0, seed3=0) {
c = base + rands(0, 0.2, 3, round(1000000 * sin(0.329045 + 17*seed1 + 23*seed2 + 29*seed3)));
color(c)
children();
}
for (x = [0:num_hdd_x])
for (y = [0:num_hdd_y-1])
translate([bar_thickness/2 + x*tray_width, 0, y*tray_height]) {
// front connector
rand_color([0.0, 0.8, 0.0], x, y)
front_connector(
border_left = x == 0,
border_right = x == num_hdd_x,
border_top = y == num_hdd_y - 1,
border_bottom = y == 0
);
// back connector
rand_color([0.0, 0.8, 0.0], y, x)
translate([0, hdd_length - hdd_standout - bar_thickness, 0])
back_connector(
border_left = x == 0,
border_right = x == num_hdd_x,
border_top = y == num_hdd_y - 1,
border_bottom = y == 0
);
// internal elements (that have nothing right of the last hdd column)
if (x != num_hdd_x) {
// rails
rand_color([0.7, 0.7, 0.7], -x, y)
translate([bar_thickness/2 - rail_thickness, 0, bar_thickness - rail_thickness])
rail();
rand_color([0.7, 0.7, 0.7], x, -y)
translate([tray_width + rail_thickness - bar_thickness/2, 0, bar_thickness - rail_thickness])
mirror()
rail();
// backplane (to be inserted into the back connector)
translate([backplane_hoffset, hdd_length - hdd_standout,
backplane_voffset])
backplane_populated();
}
}
// back connector pole
// TODO: split correctly if size exceeds printing area
for (x = [0:num_hdd_x])
assign(border = (x==0 || x==num_hdd_x))
translate([x*tray_width,
hdd_length - hdd_standout + (border ? 0 : backplane_thickness),
y*tray_height])
connector_pole(num_hdd_y,
pole_depth - (border ? 0 : backplane_thickness),
cable_funnel = !border);
// thread rods
for (x = [0:num_hdd_x])
translate([bar_thickness/2 + x * tray_width, bar_thickness/2, -tray_height/2])
cylinder(h = (num_hdd_y + 1) * tray_height, r = rod_diameter/2, $fs=0.1);
// vertical front screws
for (x = [0:num_hdd_x-1])
for (y = [0:num_hdd_y-1])
translate([(x + 0.5) * tray_width - bar_thickness, bar_thickness * 1.5, (y+1) * tray_height - bar_thickness/2])
rotate([0, 90, 0])
cylinder(h = 3 * bar_thickness, r = rod_diameter/2, $fs=0.1);
translate([bar_thickness + floor(num_hdd_x/2) * tray_width, -hdd_standout, bar_thickness + floor(num_hdd_y/2) * tray_height])
color("Blue") hdd();
echo("MODEL INFO: total height = ", num_hdd_y * tray_height);
echo("MODEL INFO: total width = ", num_hdd_x * tray_width + bar_thickness);
|