lid.scad 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. // Sliding lid for EE04 case — integrates epd_case as ceiling
  2. // z=0 = bottom of flanges; z=FLANGE_H = ceiling underside / epd_case backplate bottom
  3. include <params.scad>
  4. use <epd_case.scad>
  5. use <GDEY0583T81.scad>
  6. /* [Preview] */
  7. SHOW_DISP = true;
  8. // ============================================================
  9. // LID (slide-on; enters from Y- face, closes toward Y+)
  10. // Flanges sit inside cavity and ride on base retention flange hypotenuses.
  11. // ============================================================
  12. module lid() {
  13. // Flanges: right triangles in XZ; hypotenuse at reciprocal angle to base retention flanges.
  14. // Wide vertical face at x=WALL+FLANGE_W (inner), tip at bottom-wall-face — same
  15. // (-FLANGE_W, -FLANGE_H) hypotenuse slope as base flanges so they mate when lid slides in.
  16. color("#2C3863") {
  17. // Left (X-) flange — stops at Y+ locking flange inner face
  18. hull() {
  19. translate([WALL + FLANGE_W - SLIDE_CLEAR - 0.01, 0, 0])
  20. cube([0.01, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, FLANGE_H - SLIDE_CLEAR]);
  21. translate([WALL + SLIDE_CLEAR, 0, -0.005])
  22. cube([0.01, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, 0.01]);
  23. }
  24. // Right (X+) flange — stops at Y+ locking flange inner face
  25. hull() {
  26. translate([OUT_L - WALL - FLANGE_W + SLIDE_CLEAR, 0, 0])
  27. cube([0.01, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, FLANGE_H - SLIDE_CLEAR]);
  28. translate([OUT_L - WALL - SLIDE_CLEAR - 0.01, 0, -0.005])
  29. cube([0.01, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, 0.01]);
  30. }
  31. // Interior ribs — 2 mm wide
  32. translate([WALL + FLANGE_W - SLIDE_CLEAR, 0, 0])
  33. cube([2.0, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, FLANGE_H]);
  34. translate([OUT_L - WALL - FLANGE_W + SLIDE_CLEAR - 2.0, 0, 0])
  35. cube([2.0, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, FLANGE_H]);
  36. // Y+ locking flanges — angled wedge matching side-flange profile; split around FPC notch
  37. for (seg = [
  38. [FLANGE_W - SLIDE_CLEAR + 2.0,
  39. 2+PCB_OX + FPC_CX - FPC_NOTCH_W/2 - (WALL + FLANGE_W - SLIDE_CLEAR + 2.0)],
  40. [PCB_OX + FPC_CX + FPC_NOTCH_W/2,
  41. OUT_L - FLANGE_W + SLIDE_CLEAR - 2.0 - (PCB_OX + FPC_CX + FPC_NOTCH_W/2)]
  42. ]) {
  43. hull() {
  44. translate([seg[0], LID_Y_LEN - FLANGE_W + SLIDE_CLEAR - 0.01, 0])
  45. cube([seg[1], 0.01, FLANGE_H - SLIDE_CLEAR]);
  46. translate([seg[0], LID_Y_LEN - SLIDE_CLEAR - 0.01, -0.005])
  47. cube([seg[1], 0.01, 0.01]);
  48. }
  49. // Backing rib — 2 mm deep on cavity face of flange, matches side-rib style
  50. translate([seg[0], LID_Y_LEN - FLANGE_W + SLIDE_CLEAR - 2.0, 0])
  51. cube([seg[1], 2.0, FLANGE_H]);
  52. }
  53. }
  54. color("#004B49")
  55. difference() {
  56. union() {
  57. if (!EPD_IS_LID)
  58. // Flat ceiling plate — test fit without epd_case geometry
  59. translate([0, -WALL, FLANGE_H])
  60. rounded_box(OUT_L, OUT_W, LID_T, CORNER_R);
  61. else
  62. translate([
  63. OUT_L/2 - epd_case_w/2,
  64. OUT_W - epd_case_d - WALL,
  65. LID_T
  66. ])
  67. epd_case();
  68. // Y- lip — same rounded_box profile clipped to the Y- wall zone so the
  69. // lip corners match the base exterior corners
  70. intersection() {
  71. translate([0, -WALL, -SLIDE_CLEAR])
  72. rounded_box(OUT_L, OUT_W, FLANGE_H + SLIDE_CLEAR, CORNER_R);
  73. translate([-0.1, -WALL - 0.1, -SLIDE_CLEAR - 0.1])
  74. cube([OUT_L + 0.2, WALL + 0.2, FLANGE_H + SLIDE_CLEAR + 0.2]);
  75. }
  76. }
  77. // FPC cable slot — from Y+ face of U-rib bottom bar, FPC_SLOT_W toward Y+
  78. translate([PCB_OX + FPC_CX - FPC_NOTCH_W/2,
  79. LID_Y_LEN - 3 - FPC_U_DEPTH + FPC_U_T,
  80. FLANGE_H - 0.1])
  81. cube([FPC_NOTCH_W, FPC_SLOT_W, LID_T + 0.2]);
  82. }
  83. // Display mockup — seated inside epd_case, preview only
  84. if ($preview && EPD_IS_LID && SHOW_DISP)
  85. translate([
  86. OUT_L/2 - epd_case_w/2 + WALL + TOL,
  87. OUT_W - epd_case_d - WALL + BEZEL_Y,
  88. LID_T + WALL
  89. ])
  90. GDEY0583T81(fpc_bend_start=0, fpc_bend_r=FPC_BEND_R, fpc_post_clip=2);
  91. }
  92. // ============================================================
  93. // RENDER
  94. // ============================================================
  95. lid();