$fn=0; // 0 = default in2mm = 25.4; M3_clearance_radius = 0.5*3.3; p_hgt = 222.0; p_wid = 482.6; p_thk = 3.175; panel=[p_wid, p_hgt]; h_c2c = 6.0 * in2mm; h_dia = 7.9; h_mount_dia = 0*5.0; // diavalves rack_min_opening = 450; rack_side_gaps = 0.5*(p_wid - rack_min_opening); valve_dia = 48.0; // diavalves of valves case valve_xoff = 20; valve_yoff = 25; valve_tabs = [ [ +valve_xoff, +valve_yoff ], [ +valve_xoff, -valve_yoff ], [ -valve_xoff, +valve_yoff ], [ -valve_xoff, -valve_yoff ], ]; xv_del = 55; xv_num = 8; xv_off = 0.5*(p_wid - (xv_num-1)*xv_del); // centers yv_off = p_thk; xv_posns = [ for (x = [0:xv_del:xv_num*xv_del-1]) xv_off + x ]; // top row of valvess 35 mm, 65 mm spacing zv_off = p_hgt-35; zv_posns = [ for (z = [0, 65 ]) zv_off - z ]; // valves centerline zv_ctr = 0.5*( zv_posns[0] + zv_posns[1] ); // ======================================================================== // MOUNTING PLATES // ======================================================================== plate=[ 135, 80, 2 ]; plate_hole_c2c = [ 130, 70 ]; plate_holes = [ [ +0.5*plate_hole_c2c.x, +0.5*plate_hole_c2c.y ], [ +0.5*plate_hole_c2c.x, -0.5*plate_hole_c2c.y ], [ -0.5*plate_hole_c2c.x, +0.5*plate_hole_c2c.y ], [ -0.5*plate_hole_c2c.x, -0.5*plate_hole_c2c.y ] ]; module make_plate_screw_holes() { for(xy=plate_holes) { translate(xy) cylinder(h=10, r=M3_clearance_radius, center=true); } } // bottom row of gear along this centerline: zbase = 45; // justify plate mounting holes with valve mounting holes xplate_bee = xv_posns[0] + 0.5*plate_hole_c2c.x - valve_xoff; xplate_dog = xv_posns[xv_num-1] - 0.5*plate_hole_c2c.x + valve_xoff; // ======================================================================== // VALVES // ======================================================================== module place_valve() { rotate(90,[1,0,0]) children(); } module make_valve_assy_screw_holes() { for(xy = valve_tabs) translate(xy) cylinder(r=M3_clearance_radius, h=10, center=true); } module array_valves_row(y,z) { for(x=xv_posns) translate([x,y,z]) children(); } // ======================================================================== // STEAMED DUMPLINGS // ======================================================================== dump = [ 121.0, 76.0, 12.6 ]; dump_hole_c2c = [113, 68]; dump_holes = [ [ +0.5*dump_hole_c2c.x, +0.5*dump_hole_c2c.y ], [ +0.5*dump_hole_c2c.x, -0.5*dump_hole_c2c.y ], [ -0.5*dump_hole_c2c.x, +0.5*dump_hole_c2c.y ], [ -0.5*dump_hole_c2c.x, -0.5*dump_hole_c2c.y ] ]; module make_dumplings_cutout() { cube([dump.x, dump.y, 20]+[2,2,0], center=true); } module make_dumplings_holes() { for(xy=dump_holes) { translate(xy) cylinder(h=4*dump.z, r=M3_clearance_radius, center=true); } } // ======================================================================== // AUX OBJECTS // ======================================================================== module place_dog_bowl_unit() { translate([xplate_dog, 0*plate.z, zbase]) rotate(-90,[1,0,0]) children(); } module place_bee_hive_unit() { translate([xplate_bee,0,zbase]) rotate(-90,[1,0,0]) rotate(180,[0,0,1]) translate([0,0,0*p_thk]) children(); } module place_cabinet() { translate([0.5*p_wid,0,zbase]) rotate(-90,[1,0,0]) children(); } // ======================================================================== // VENTS // ======================================================================== vent_dia = 37.8; // cone diavalves vent_magnet_dia = 23.8; // cone diavalves spk = [42.5, 42.5, 20.4 ]; // size, less front cone vent_hole_c2c = [ 34, 34 ]; vent_hole_dia = 3.2; vent_off = 2; vent_bkt_rad = 2; vent_holes = [ [ +0.5*vent_hole_c2c.x, +0.5*vent_hole_c2c.y ], [ +0.5*vent_hole_c2c.x, -0.5*vent_hole_c2c.y ], [ -0.5*vent_hole_c2c.x, +0.5*vent_hole_c2c.y ], [ -0.5*vent_hole_c2c.x, -0.5*vent_hole_c2c.y ] ]; // two ways to make vent... // (1) one big hole, or module make_vent_cutouts() { cylinder(h=5*vent_off, d=vent_dia+4, center=true); for(xy=vent_holes) { translate(xy) cylinder(h=5*vent_off, d=vent_hole_dia, center=true); // cylinder_print(h=5*vent_off, d=vent_hole_dia, center=true); } } // (2) pattern of many holes pattern_num_rings = 7; pattern_rad_beg = 0.5*vent_dia; pattern_rad_end = 0.0*vent_dia; pattern_rad_del = (pattern_rad_end - pattern_rad_beg) / pattern_num_rings; pattern_chord_del = 3.5; pattern_hole_dia = 2; module make_vent_pattern() { color("black") { for(j=[0:1:pattern_num_rings]) { rad = pattern_rad_end - j*pattern_rad_del; num_holes = floor(2.0*rad*PI / pattern_chord_del); hole_del = 360.0 / num_holes; for(i=[0:1:num_holes-1]) { ang = i*hole_del + (j%2)*0.5*hole_del; xy = [ rad*cos(ang), rad*sin(ang) ]; translate(xy) cylinder(h=5*vent_off, d=pattern_hole_dia, center=true); } } cylinder(h=5*vent_off, d=pattern_hole_dia, center=true); } } module place_vent_left() { translate([xplate_bee,p_thk,zbase]) rotate(90,[1,0,0]) children(); } module place_vent_right() { translate([xplate_dog,p_thk,zbase]) rotate(90,[1,0,0]) rotate(180,[0,0,1]) children(); } // ======================================================================== // FAUCET // ======================================================================== faucet_dia = 0.438 * in2mm; module make_faucet_hole() { rotate(90,[1,0,0]) cylinder(h=10, d=faucet_dia, center=true ); } module place_faucet() { translate([0.5*p_wid+0.5*dump.x+14,p_thk+0.75,0.5*zbase]) children(); } // ======================================================================== // FINALLY, THE 19-INCH RACK MAIN PANEL // ======================================================================== module make_panel() { color("#171717") cube([p_wid, p_thk, p_hgt]); } handle_c2c = 6 *in2mm; // 6 inches center to center handle_hole_dia = 5.24; module make_handle_holes() { for( z=[0.5*handle_c2c, -0.5*handle_c2c] ) { translate([0,0,z]) rotate(90,[1,0,0]) cylinder(h=10*p_thk, d=handle_hole_dia, center=true); } } rack_mount_width = 15.875; horz_spacing = rack_mount_width / 2; module place_handles() { for( x = [ 2*horz_spacing, p_wid - 2*horz_spacing ] ) { translate([x,0,0.5*p_hgt]) children(); } } // machine out the panel with the various features module machine_panel() { difference() { make_panel(); union() { for(z=zv_posns) { array_valves_row(0,z) { rotate(90,[1,0,0]) translate([0,0,-0.5*p_thk]) cylinder(h=2*p_thk, d=valve_dia+1, center=true); } for(x=xv_posns) translate([x,0,z]) place_valve() make_valve_assy_screw_holes(); } place_handles() make_handle_holes(); place_cabinet() make_dumplings_cutout(); place_cabinet() make_plate_screw_holes(); place_dog_bowl_unit() make_plate_screw_holes(); place_bee_hive_unit() make_plate_screw_holes(); if(true) { place_vent_left() make_vent_cutouts(); place_vent_right() make_vent_cutouts(); } else { place_vent_right() make_vent_pattern(); place_vent_left() make_vent_pattern(); } place_faucet() make_faucet_hole(); } } } // projection() translate([0,0,p_thk]) rotate(-90,[1,0,0]) machine_panel();