// 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 use /* [Preview] */ SHOW_DISP = true; /* [FPC Adapter Mount] */ ADAPT_SLOT_GAP = 10.0; // gap: adapter Y+ edge to slot Y- edge ← tune // Adapter board dimensions (must match fpc_adapter.scad PCB_W / PCB_H) _adpt_w = 32.0; _adpt_h = 18.0; // Derived adapter position in lid XY space _slot_y = LID_Y_LEN - 3 - FPC_U_DEPTH + FPC_U_T; // slot Y- edge _adapt_ox = PCB_OX + FPC_CX - _adpt_w / 2; // adapter PCB X- edge _adapt_oy = _slot_y - ADAPT_SLOT_GAP - _adpt_h; // adapter PCB Y- edge // ============================================================ // 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 flanges — angled wedge matching side-flange profile; split around FPC notch for (seg = [ [FLANGE_W - SLIDE_CLEAR + 2.0, 2+PCB_OX + FPC_CX - FPC_NOTCH_W/2 - (WALL + FLANGE_W - SLIDE_CLEAR + 2.0)], [PCB_OX + FPC_CX + FPC_NOTCH_W/2, OUT_L - FLANGE_W + SLIDE_CLEAR - 2.0 - (PCB_OX + FPC_CX + FPC_NOTCH_W/2)] ]) { hull() { translate([seg[0], LID_Y_LEN - FLANGE_W + SLIDE_CLEAR - 0.01, 0]) cube([seg[1], 0.01, FLANGE_H - SLIDE_CLEAR]); translate([seg[0], LID_Y_LEN - SLIDE_CLEAR - 0.01, -0.005]) cube([seg[1], 0.01, 0.01]); } // Backing rib — 2 mm deep on cavity face of flange, matches side-rib style translate([seg[0], LID_Y_LEN - FLANGE_W + SLIDE_CLEAR - 2.0, 0]) cube([seg[1], 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("#004B49") 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 + WALL]) rotate([-EPD_ANGLE, 0, 0]) translate([0, -epd_case_d, 0]) epd_case(); // 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, LID_Y_LEN - 3 - FPC_U_DEPTH + FPC_U_T, FLANGE_H - 0.1]) cube([FPC_NOTCH_W, FPC_SLOT_W, LID_T + 0.2]); } } // ============================================================ // RENDER // ============================================================ lid();