diff --git a/cube.scad b/cube.scad index 765a458..29fc82c 100644 --- a/cube.scad +++ b/cube.scad @@ -19,7 +19,13 @@ W = 115; // width (X) D = 115; // depth (Y) — front face is -Y, back face is +Y H = 115; // height (Z) wall = 2.0; -split_z = 70; // bottom shell height (top shell = H - split_z = 45) + +// Lid (top shell) height — half of v2's 45 mm. Bottom shell grows to fill the +// rest of H. The front panel sits between two equal frames of bottom-shell +// color: `lid_h` of frame above (= top shell) and `lid_h` of frame below +// (= bottom-shell front-wall section under the panel). +lid_h = 22.5; +split_z = H - lid_h; // bottom shell height (= 92.5) // ---- snap lip (3-sided: left, right, back; no front) ---- lip_h = 6.0; @@ -37,6 +43,7 @@ ledge_h = 1.5; panel_thick = 2.5; // panel Y thickness panel_recess = 1.0; // panel front face recessed from cube front face by this slide_clear = 0.3; // sliding-fit clearance (per side) +front_frame_h = lid_h; // bottom-shell front-wall height under the panel // ---- front channel rib parameters ---- rib_x_extra = 3.0; // rib extends inward from inner wall face by this in X @@ -53,12 +60,15 @@ back_ports = [ 18], // z above floor ]; -// front panel: data ports (panel-local coords; x=0 is panel left edge, z=0 is bottom) +// front panel: data ports (panel-local coords; x=0 is panel left edge, z=0 is bottom). +// Vertically centered: each port's z is `panel_h/2 - port_h/2`, with +// panel_h derived below. +function port_z(h) = (split_z - front_frame_h)/2 - h/2; panel_ports = [ - ["hdmi_in", 14.0, 6.5, 20, 25], - ["hdmi_out", 14.0, 6.5, 39, 25], - ["usb_a", 13.0, 6.0, 58, 26], - ["usb_c", 9.0, 3.5, 76, 27.5], + ["hdmi_in", 14.0, 6.5, 20, port_z(6.5)], + ["hdmi_out", 14.0, 6.5, 39, port_z(6.5)], + ["usb_a", 13.0, 6.0, 58, port_z(6.0)], + ["usb_c", 9.0, 3.5, 76, port_z(3.5)], ]; // ---- preview / explode ---- @@ -76,8 +86,8 @@ slot_x_min_L = wall + rib_x_extra - slot_x_depth; slot_x_max_L = wall + rib_x_extra + 0.1; // breaks through inner face slot_y_min = panel_recess - slide_clear/2; slot_y_max = panel_recess + panel_thick + slide_clear/2; -slot_z_min = wall; -slot_z_max = split_z + 1; // extends above rib top +slot_z_min = front_frame_h; // slot bottom = panel bottom +slot_z_max = split_z + 1; // extends above rib top // Panel X extent — left edge at -X end of left slot (with clearance), mirrored panel_x_min = slot_x_min_L + slide_clear; @@ -86,7 +96,7 @@ panel_x_max = W - slot_x_min_L - slide_clear; // Panel Y / Z extents panel_y_min = panel_recess; panel_y_max = panel_recess + panel_thick; -panel_z_min = wall; +panel_z_min = front_frame_h; // panel sits on top of the bottom-shell front wall panel_z_max = split_z; // top of panel meets the top shell exactly // Snap positions (3 sides, no front) @@ -155,11 +165,13 @@ module lip_ring_3sided() { // Front-left channel rib: block at the inner front-left corner with a vertical // slot cut through its inner face. Panel's left edge slides down into the slot. +// Rib extends the full height of the bottom-shell side walls; the slot only +// exists above the front-wall section (z >= front_frame_h). module left_front_rib() { difference() { translate([wall, 0, wall]) cube([rib_x_extra, rib_y, split_z - wall]); - translate([slot_x_min_L, slot_y_min, slot_z_min - 0.01]) + translate([slot_x_min_L, slot_y_min, slot_z_min]) cube([slot_x_max_L - slot_x_min_L, slot_y_max - slot_y_min, slot_z_max - slot_z_min + 0.01]); @@ -186,10 +198,13 @@ module back_port_cuts() { module bottom_shell() { difference() { union() { - // 3 outer walls (left, right, back) - translate([0, 0, wall]) cube([wall, D, split_z - wall]); - translate([W - wall, 0, wall]) cube([wall, D, split_z - wall]); - translate([wall, D - wall, wall]) cube([W - 2*wall, wall, split_z - wall]); + // 4 outer walls — left/right/back full height, front partial (frame under panel) + translate([0, 0, wall]) cube([wall, D, split_z - wall]); + translate([W - wall, 0, wall]) cube([wall, D, split_z - wall]); + translate([wall, D - wall, wall]) cube([W - 2*wall, wall, split_z - wall]); + // front frame wall — only up to panel bottom + translate([wall, 0, wall]) + cube([W - 2*wall, wall, front_frame_h - wall]); // floor cube([W, D, wall]);