| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- // 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 <params.scad>
- use <epd_case.scad>
- use <GDEY0583T81.scad>
- /* [Preview] */
- SHOW_DISP = true;
- // ============================================================
- // 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, -SLIDE_CLEAR])
- rounded_box(OUT_L, OUT_W, FLANGE_H + SLIDE_CLEAR, CORNER_R);
- translate([-0.1, -WALL - 0.1, -SLIDE_CLEAR - 0.1])
- cube([OUT_L + 0.2, WALL + 0.2, FLANGE_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);
- }
- // ============================================================
- // RENDER
- // ============================================================
- lid();
|