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
|
include <parameters.scad>
use <connector_front.scad>
use <hdd.scad>
use <rail.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]) {
// front connector
rand_color([0.0, 0.8, 0.0], x, y) translate([bar_thickness/2 + x*tray_width, 0, y*tray_height])
front_connector(
border_left = x == 0,
border_right = x == num_hdd_x,
border_top = y == num_hdd_y - 1,
border_bottom = y == 0
);
// rail
if (x != num_hdd_x)
translate([x * tray_width, 0, y * tray_height]) {
rand_color([0.7, 0.7, 0.7], -x, y) translate([bar_thickness - rail_thickness, 0, bar_thickness - rail_thickness])
rail();
rand_color([0.7, 0.7, 0.7], x, -y) translate([tray_width + rail_thickness, 0, bar_thickness - rail_thickness])
mirror() rail();
}
// TODO: back connector
}
// 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);
for (y = [0:num_hdd_y-1])
translate([-tray_width/4, bar_thickness * 1.5, (y+1) * tray_height - bar_thickness/2])
rotate([0, 90, 0])
cylinder(h = (num_hdd_x + 0.5) * tray_width, 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();
|