// Sliding lid for EE04 case — integrates epd_case as ceiling // z=0 = bottom of flanges; ceiling at z=LID_T (epd_case backplate) or z=FLANGE_H (flat test plate) include use use /* [Preview] */ SHOW_DISP = true; // Hinge drum — EPD_ANGLE-swept partial cylinder filling the gap between the flat // plate and the tilted epd_case back. Radius reaches WALL past the Y- edge of the // flat-plate FPC slot so a cable path can later be cut inside it. FPC_SLOT_Y0 = LID_Y_LEN - 3 - FPC_U_DEPTH + FPC_U_T; HINGE_R = (OUT_W - WALL) - FPC_SLOT_Y0 + WALL; // ============================================================ // LID (slide-on; enters from Y- face, closes toward Y+) // Flanges sit inside cavity and ride on base retention flange hypotenuses. // ============================================================ module lid() { // Flanges: right triangles in XZ; hypotenuse at reciprocal angle to base retention flanges. // Wide vertical face at x=WALL+FLANGE_W (inner), tip at bottom-wall-face — same // (-FLANGE_W, -FLANGE_H) hypotenuse slope as base flanges so they mate when lid slides in. color("#2C3863") { // Left (X-) flange hull() { translate([WALL + FLANGE_W - SLIDE_CLEAR - 0.01, 0, 0]) cube([0.01, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, FLANGE_H - SLIDE_CLEAR]); translate([WALL + SLIDE_CLEAR, 0, -0.005]) cube([0.01, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, 0.01]); } // Right (X+) flange hull() { translate([OUT_L - WALL - FLANGE_W + SLIDE_CLEAR, 0, 0]) cube([0.01, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, FLANGE_H - SLIDE_CLEAR]); translate([OUT_L - WALL - SLIDE_CLEAR - 0.01, 0, -0.005]) cube([0.01, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, 0.01]); } // Interior ribs — 2 mm wide translate([WALL + FLANGE_W - SLIDE_CLEAR, 0, 0]) cube([2.0, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, FLANGE_H]); translate([OUT_L - WALL - FLANGE_W + SLIDE_CLEAR - 2.0, 0, 0]) cube([2.0, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, FLANGE_H]); // Y+ locking flange — single angled wedge matching side-flange profile. // Spans the whole face (the old FPC notch split is no longer needed thanks // to the Y- clearance) and shields the cable from pinching during assembly. _ypf_x0 = FLANGE_W - SLIDE_CLEAR + 2.0; _ypf_w = OUT_L - FLANGE_W + SLIDE_CLEAR - 2.0 - _ypf_x0; hull() { translate([_ypf_x0, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR - 0.01, 0]) cube([_ypf_w, 0.01, FLANGE_H - SLIDE_CLEAR]); translate([_ypf_x0, LID_Y_LEN - SLIDE_CLEAR - 0.01, -0.005]) cube([_ypf_w, 0.01, 0.01]); } // Backing rib — 2 mm deep on cavity face of flange, matches side-rib style translate([_ypf_x0, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR - 2.0, 0]) cube([_ypf_w, 2.0, FLANGE_H]); // Y+ corners — intersection of the X-prism and Y-prism in the corner region. // Equivalent to: cube with the X-flange relief cut AND the Y-flange relief cut applied. // Result tapers to zero height along both wall faces, producing a single shared edge. // Left corner (X-) intersection() { hull() { translate([WALL + FLANGE_W - SLIDE_CLEAR - 0.01, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, 0]) cube([0.01, FLANGE_W - 2*SLIDE_CLEAR, FLANGE_H - SLIDE_CLEAR]); translate([WALL + SLIDE_CLEAR, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, -0.005]) cube([0.01, FLANGE_W - 2*SLIDE_CLEAR, 0.01]); } hull() { translate([WALL + SLIDE_CLEAR, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, 0]) cube([FLANGE_W - 2*SLIDE_CLEAR, 0.01, FLANGE_H - SLIDE_CLEAR]); translate([WALL + SLIDE_CLEAR, LID_Y_LEN - SLIDE_CLEAR - 0.01, -0.005]) cube([FLANGE_W - 2*SLIDE_CLEAR, 0.01, 0.01]); } } // Right corner (X+) intersection() { hull() { translate([OUT_L - WALL - FLANGE_W + SLIDE_CLEAR, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, 0]) cube([0.01, FLANGE_W - 2*SLIDE_CLEAR, FLANGE_H - SLIDE_CLEAR]); translate([OUT_L - WALL - SLIDE_CLEAR - 0.01, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, -0.005]) cube([0.01, FLANGE_W - 2*SLIDE_CLEAR, 0.01]); } hull() { translate([OUT_L - WALL - FLANGE_W + SLIDE_CLEAR, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, 0]) cube([FLANGE_W - 2*SLIDE_CLEAR, 0.01, FLANGE_H - SLIDE_CLEAR]); translate([OUT_L - WALL - FLANGE_W + SLIDE_CLEAR, LID_Y_LEN - SLIDE_CLEAR - 0.01, -0.005]) cube([FLANGE_W - 2*SLIDE_CLEAR, 0.01, 0.01]); } } } difference() { union() { // Flat ceiling plate for EPD_ANGLE > 0 color("#2C3863") translate([0, -WALL, FLANGE_H]) rounded_box(OUT_L, OUT_W, LID_T, CORNER_R); if (EPD_IS_LID) { translate([OUT_L/2 - epd_case_w/2, OUT_W - WALL, LID_T + LIP]) rotate([-EPD_ANGLE, 0, 0]) translate([0, -epd_case_d, 0]) epd_case(); // Hinge drum — axis along X at the epd_case pivot line; swept from the // flat-plate plane up through EPD_ANGLE to sit flush against the case back. // Inset CORNER_R from each end so it stays clear of the corner rounding. if (EPD_ANGLE > 0) color("#004B49") translate([OUT_L/2 - epd_case_w/2 + CORNER_R, OUT_W - WALL, LID_T + LIP]) rotate([0, 90, 0]) pie_slice(ang=EPD_ANGLE, l=epd_case_w - 2*CORNER_R, r=HINGE_R, spin=270 - EPD_ANGLE, anchor=BOT, $fn=96); } // Y- lip — same rounded_box profile clipped to the Y- wall zone so the // lip corners match the base exterior corners color("#004B49") intersection() { translate([0, -WALL, FLANGE_H - LIP_H - SLIDE_CLEAR]) rounded_box(OUT_L, OUT_W, LIP_H + SLIDE_CLEAR, CORNER_R); translate([-0.1, -WALL - 0.1, FLANGE_H - LIP_H - SLIDE_CLEAR - 0.1]) cube([OUT_L + 0.2, WALL + 0.2, LIP_H + SLIDE_CLEAR + 0.2]); } } // FPC cable slot — through flat ceiling plate (test-fit lid only; EPD_IS_LID uses epd_case slot) translate([PCB_OX + FPC_CX - FPC_NOTCH_W/2, FPC_SLOT_Y0, FLANGE_H - 0.1]) cube([FPC_NOTCH_W, FPC_SLOT_W, LID_T + 0.2]); // Cable channel through hinge drum — straight tapered passage hulled between // the flat-plate slot mouth and the epd_case backplate slot exit on the tilted // face. Both mouths share the same X extent; the hull stays >1.9 mm inside the // drum's curved surface. if (EPD_IS_LID && EPD_ANGLE > 0) hull() { translate([PCB_OX + FPC_CX - FPC_NOTCH_W/2, FPC_SLOT_Y0, FLANGE_H + LID_T - 0.1]) cube([FPC_NOTCH_W, FPC_SLOT_W, 0.2]); translate([OUT_L/2 - epd_case_w/2, OUT_W - WALL, LID_T + LIP]) rotate([-EPD_ANGLE, 0, 0]) translate([_fpc_x1, BEZEL_Y + DISP_D + DISP_Y_EXTRA - epd_case_d, -0.1]) cube([_fpc_xw, FPC_SLOT_W, 0.2]); } } } // ============================================================ // RENDER // ============================================================ lid();