lid.scad 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  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
  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
  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. // Y+ corners — intersection of the X-prism and Y-prism in the corner region.
  54. // Equivalent to: cube with the X-flange relief cut AND the Y-flange relief cut applied.
  55. // Result tapers to zero height along both wall faces, producing a single shared edge.
  56. // Left corner (X-)
  57. intersection() {
  58. hull() {
  59. translate([WALL + FLANGE_W - SLIDE_CLEAR - 0.01, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, 0])
  60. cube([0.01, FLANGE_W - 2*SLIDE_CLEAR, FLANGE_H - SLIDE_CLEAR]);
  61. translate([WALL + SLIDE_CLEAR, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, -0.005])
  62. cube([0.01, FLANGE_W - 2*SLIDE_CLEAR, 0.01]);
  63. }
  64. hull() {
  65. translate([WALL + SLIDE_CLEAR, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, 0])
  66. cube([FLANGE_W - 2*SLIDE_CLEAR, 0.01, FLANGE_H - SLIDE_CLEAR]);
  67. translate([WALL + SLIDE_CLEAR, LID_Y_LEN - SLIDE_CLEAR - 0.01, -0.005])
  68. cube([FLANGE_W - 2*SLIDE_CLEAR, 0.01, 0.01]);
  69. }
  70. }
  71. // Right corner (X+)
  72. intersection() {
  73. hull() {
  74. translate([OUT_L - WALL - FLANGE_W + SLIDE_CLEAR, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, 0])
  75. cube([0.01, FLANGE_W - 2*SLIDE_CLEAR, FLANGE_H - SLIDE_CLEAR]);
  76. translate([OUT_L - WALL - SLIDE_CLEAR - 0.01, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, -0.005])
  77. cube([0.01, FLANGE_W - 2*SLIDE_CLEAR, 0.01]);
  78. }
  79. hull() {
  80. translate([OUT_L - WALL - FLANGE_W + SLIDE_CLEAR, LID_Y_LEN - FLANGE_W + SLIDE_CLEAR, 0])
  81. cube([FLANGE_W - 2*SLIDE_CLEAR, 0.01, FLANGE_H - SLIDE_CLEAR]);
  82. translate([OUT_L - WALL - FLANGE_W + SLIDE_CLEAR, LID_Y_LEN - SLIDE_CLEAR - 0.01, -0.005])
  83. cube([FLANGE_W - 2*SLIDE_CLEAR, 0.01, 0.01]);
  84. }
  85. }
  86. }
  87. color("#004B49")
  88. difference() {
  89. union() {
  90. if (!EPD_IS_LID)
  91. // Flat ceiling plate — test fit without epd_case geometry
  92. translate([0, -WALL, FLANGE_H])
  93. rounded_box(OUT_L, OUT_W, LID_T, CORNER_R);
  94. else
  95. translate([
  96. OUT_L/2 - epd_case_w/2,
  97. OUT_W - epd_case_d - WALL,
  98. LID_T
  99. ])
  100. epd_case();
  101. // Y- lip — same rounded_box profile clipped to the Y- wall zone so the
  102. // lip corners match the base exterior corners
  103. intersection() {
  104. translate([0, -WALL, -SLIDE_CLEAR])
  105. rounded_box(OUT_L, OUT_W, FLANGE_H + SLIDE_CLEAR, CORNER_R);
  106. translate([-0.1, -WALL - 0.1, -SLIDE_CLEAR - 0.1])
  107. cube([OUT_L + 0.2, WALL + 0.2, FLANGE_H + SLIDE_CLEAR + 0.2]);
  108. }
  109. }
  110. // FPC cable slot — from Y+ face of U-rib bottom bar, FPC_SLOT_W toward Y+
  111. translate([PCB_OX + FPC_CX - FPC_NOTCH_W/2,
  112. LID_Y_LEN - 3 - FPC_U_DEPTH + FPC_U_T,
  113. FLANGE_H - 0.1])
  114. cube([FPC_NOTCH_W, FPC_SLOT_W, LID_T + 0.2]);
  115. }
  116. // Display mockup — seated inside epd_case, preview only
  117. if ($preview && EPD_IS_LID && SHOW_DISP)
  118. translate([
  119. OUT_L/2 - epd_case_w/2 + WALL + TOL,
  120. OUT_W - epd_case_d - WALL + BEZEL_Y,
  121. LID_T + WALL
  122. ])
  123. GDEY0583T81(fpc_bend_start=0, fpc_bend_r=FPC_BEND_R, fpc_post_clip=2);
  124. }
  125. // ============================================================
  126. // RENDER
  127. // ============================================================
  128. lid();