// Sliding lid for EE04 case — integrates epd_case as ceiling // z=0 = bottom of flanges; z=FLANGE_H = ceiling underside / epd_case backplate bottom 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]); } } } color("#004B49") difference() { union() { if (!EPD_IS_LID) // Flat ceiling plate — test fit without epd_case geometry translate([0, -WALL, FLANGE_H]) rounded_box(OUT_L, OUT_W, LID_T, CORNER_R); else translate([ OUT_L/2 - epd_case_w/2, OUT_W - epd_case_d - WALL, LID_T ]) epd_case(); // Y- lip — same rounded_box profile clipped to the Y- wall zone so the // lip corners match the base exterior corners 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 — from Y+ face of U-rib bottom bar, FPC_SLOT_W toward Y+ 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]); } // Display mockup — seated inside epd_case, preview only if ($preview && EPD_IS_LID && SHOW_DISP) translate([ OUT_L/2 - epd_case_w/2 + WALL + TOL, OUT_W - epd_case_d - WALL + BEZEL_Y, LID_T + WALL ]) GDEY0583T81(fpc_bend_start=0, fpc_bend_r=FPC_BEND_R, fpc_post_clip=2); // FPC adapter — bosses always (structural); PCB/connectors shown only in $preview. // rotate([0,180,0]) flips Z without disturbing ±Y connector exits; +_adpt_w re-centres X. translate([_adapt_ox + _adpt_w, _adapt_oy, FLANGE_H - BOSS_H]) rotate([0, 180, 0]) fpc_adapter(fpc_yp=14, fpc_yn=60); } // ============================================================ // RENDER // ============================================================ lid();