include use function as(x, d) = (x-d)/x; function inflow_outline(i, k=0.1) = (i > 0) ? concat( [[i, (1 - exp(-i))/(1 - exp(-1))/2]], inflow_outline(i-k), [[i, (1 - exp(-i))/(1 - exp(-1))/-2]] ) : [[0, 0]]; module inflow(W, R) { rotate([90, 0, 0]) rotate([0, 90, 0]) linear_extrude(height = W, center=true) scale(R) polygon(inflow_outline(1)); } module inflow_grid(W, H, RW, RH, offset) { for (i = [1:num_hdd_y-1]) translate([0, 0, i*(hrail_height + hdd_height) + hdd_height/2 + offset]) difference() { inflow(W, RW); translate([0, 2.1, 0]) inflow(W, RW-2); } for (i = [-1,1]) translate([i*W/2, 0, H/2]) scale([RH/RW, 1, 1]) rotate([0, 90, 0]) difference() { inflow(H, RW); translate([0, 2.1, 0]) inflow(H-2, RW-2); } } module entry(capped_bottom=true) { W = hdd_length - hdd_standout; O = capped_bottom ? 4 : hrail_height; H = num_hdd_y * (hrail_height + hdd_height) + O; D = vrail_width * 5 / 8; S = 10; R = hdd_height; offset = 4; difference() { union() { side_frame(W, D, H, S, capped_bottom, reinforce=false); intersection() { translate([0, -R + D/2, 0]) inflow_grid(W, H, R, (support_bar_width + front_depth/4)*2 + 2, offset); ccube([W, large, large]); } } ccube([2*W, large, 2*(hrail_height + hdd_height) + offset]); // add joins ... a second time as they got lost somewhere on // the way :-( translate([0,D/20,0]) scale([1, 1.2, 1]) # joins(W, D); } } rotate([-90, 0, 0]) entry();