summaryrefslogtreecommitdiff
path: root/full_model.scad
diff options
context:
space:
mode:
authorJan Huwald <jh@sotun.de>2014-02-11 11:08:51 (GMT)
committerJan Huwald <jh@sotun.de>2014-02-11 11:08:51 (GMT)
commitb9b67906c16d5bc7098161af6cc8d01d21dfecfb (patch)
tree316c3ae5bb46f3237652314565b3ee5422a33fe8 /full_model.scad
parent7c3bafcc3ce2ed80538e7d2bc47bfe01e58f5873 (diff)
full model" simplify loop
Diffstat (limited to 'full_model.scad')
-rw-r--r--full_model.scad41
1 files changed, 21 insertions, 20 deletions
diff --git a/full_model.scad b/full_model.scad
index 876c972..3918d32 100644
--- a/full_model.scad
+++ b/full_model.scad
@@ -12,31 +12,32 @@ module rand_color(base, seed1=0, seed2=0, seed3=0) {
}
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
+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) translate([bar_thickness/2, 0, 0])
+ front_connector(
+ border_left = x == 0,
+ border_right = x == num_hdd_x,
+ border_top = y == num_hdd_y - 1,
+ border_bottom = y == 0
+ );
+
+ // TODO: back connector
+
+ // 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 - 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();
// backplane (to be inserted into the back connector)
translate([bar_thickness + backplane_hoffset, hdd_length - hdd_standout,
bar_thickness + backplane_voffset])
backplane_populated();
+ }
}
// thread rods
contact: Jan Huwald // Impressum