From b6fcfb4e3b47cb197c273293340d52450245617d Mon Sep 17 00:00:00 2001 From: Jan Huwald Date: Thu, 19 Feb 2015 16:30:55 +0100 Subject: rework: front diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f32bb3d --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +include $(wildcard *.dep) + +%.gcode: %.stl + cura -s $< -o $@ + +%.stl: %.scad + openscad $< -o $@ -d $*.dep + +clean: + rm *.dep *.stl diff --git a/backplane.scad b/backplane.scad deleted file mode 100644 index d1f3f9f..0000000 --- a/backplane.scad +++ /dev/null @@ -1,56 +0,0 @@ -include - -use - -module hdd_connector(w,h,d) { - difference() { - cube([w, d, h]); - translate([1, 2, 1]) - cube([w - 2, d, h - 2]); - } -} - - -// board -module backplane_pcb() { - color("sienna") - difference() { - cube([backplane_width, backplane_thickness, backplane_height]); - - // screw holes for ... - for (p = [// ... PCB screws - [0, bar_thickness/2], - [0, tray_height - bar_thickness/2], - [tray_width/2 - bar_thickness, tray_height - bar_thickness/2], - [tray_width/2 + bar_thickness, tray_height - bar_thickness/2], - - // .. assembly hooks - [rail_width/2 + bar_thickness/2, bar_thickness/2], - [tray_width/4, tray_height - bar_thickness/2] - ]) - translate([p[0] - backplane_hoffset, 0, p[1] - backplane_voffset]) - rotate([-90, 0, 0]) - screw_hole(); - } -} - -module backplane_populated() { - backplane_pcb(); - - // front connector (power + data) - color("darkgrey") - translate([backplane_con_hoffset, 0, backplane_con_voffset]) - mirror([0, 1, 0]) { - hdd_connector(backplane_con_width/ 3 * 2 + 1, backplane_con_height, backplane_con_depth); - translate([backplane_con_width / 3 * 2, 0, 0]) - hdd_connector(backplane_con_width / 3 * 1, backplane_con_height, backplane_con_depth); - } - - // back connector (data) - translate([backplane_con_hoffset + backplane_con_width / 3 * 2, - backplane_thickness, backplane_con_voffset]) - mirror([0, 1, 0]) rotate([90, 0, 0]) - hdd_connector(backplane_con_width / 3 * 1, backplane_con_height, backplane_con_depth); -} - -backplane_populated(); \ No newline at end of file diff --git a/front.scad b/front.scad new file mode 100644 index 0000000..dd98d0a --- /dev/null +++ b/front.scad @@ -0,0 +1,155 @@ +include + +use +use + +// bend radius on hdd inlet +R = 2; + +// size of the core box +W = hdd_width + vrail_width/2; +H = hdd_height + hrail_height; +D = 15; + +// strap dimensions +SW=5; +SH=1.5; + +// dimensions of the SATA power connector +spc_width=25; +spc_height=8.2; + +support_bar_width = 10; + +module back() { + translate([0, 0, 0]) + tray(D, bt=[1], power_hole=true, straps=true); + + for (i = [1:num_hdd_y-1]) + translate([0, 0, i*H]) + tray(D, bt=[-1,1], power_hole=true, straps=true); + + translate([0, 0, (num_hdd_y-1)*H]) + tray(D, bt=[-1], power_hole=true, straps=true); +} + +module front() { + intersection() { + union() { + translate([0, 0, 0*H]) + tray(D, inlet=[1]); + + for (i = [1:num_hdd_y-1]) + translate([0, 0, i*H]) + tray(D); + + translate([0, 0, num_hdd_y*H]) + tray(D, inlet=[-1], rail=false); + } + + translate([0, 0, num_hdd_y*H/2]) + ccube([2*W, D, num_hdd_y*H + hrail_height]); + } +} + +module ccube(x) cube(x, center=true); + +module tray(D, power_hole=true, straps=true, inlet=[-1,1], rail=true, support_bar=true) +//translate([0, D/2, H/2]) +union() { + difference() { + union() { + // horizontal rail + ccube([hdd_width, D, hrail_height]); + + // vertical rails + for (i = [-1,1]) + translate([i*(W/2 - vrail_width/8), 0, 0]) + ccube([vrail_width/4, D, H]); + } + + // round corners for easy hdd insertion + for (i = inlet) + translate([0, 0, i*(hdd_height + hrail_height)/2]) + hdd_inlet(); + + // notches to attach cable strap + if (straps) { + // horizontal strap holes + for (i = [-0.65, -0.12, 0.25, 0.65]) + for (k = [-1, 1]) + translate([i*hdd_width/2, 0, k*(hrail_height/2 - SH/2)]) + strap_hole(); + + // vertical strap holes + for (i = [-1, 1]) + translate([i * (hdd_width/2 + SH/2 - epsilon), 0, -hrail_height]) + rotate([0, 90, 0]) + strap_hole(); + } + + // hole for support bar + if (support_bar) + translate([0, D/4, 0]) + ccube([W, D, support_bar_width]); + + // hole for SATA power connector and cable + if (power_hole) + translate([-hdd_width/2 + 30, 0]) + ccube([spc_width, D, spc_height]); + + // space for rail + if (rail) + for (i = [0:1]) + mirror([i, 0, 0]) + translate([-hdd_width/2 - rail_thickness, -D, hrail_height/2 - rail_thickness]) + rail(); + + // female side connectors + for (i = [-1,1]) + connector_pos(i, -1); + } + + // male side connectors + for (i = [-1,1]) + connector_pos(i, 1); +} + +module connector_pos(lr, gender) +translate([lr*(W/2 + vrail_width/4), -D/2, H*lr*gender*0.3]) +connector(); + +module connector() { + intersection() { + translate([0, 2.5, 0]) ccube([vrail_width-4, 5, 10]); + rotate([45, 0, 0]) ccube([vrail_width-4, 5, 5]); + } +} + +module strap_hole() { + ccube([SW, D, SH]); +} + +module hdd_inlet() + render() + for (i = [0,1]) mirror([i, 0, 0]) + for (j = [0,1]) mirror([0, j, 0]) + for (k = [0,1]) mirror([0, 0, k]) + difference() { + union() { + translate([0, D/2-R, 0]) + cube([hdd_width/2 + R, D, hdd_height/2 + R]); + + cube([hdd_width/2, D/2-R, hdd_height/2]); + }; + + translate([hdd_width/2 + R, D/2-R, 0]) + rotate([0, 0, 0]) + cylinder(r=R, h=H, center=true); + + translate([0, D/2-R, hdd_height/2 + R]) + rotate([0, 90, 0]) + cylinder(r=R, h=W, center=true); + } + +front(); \ No newline at end of file -- cgit v0.10.1