lid.scad 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. // Sliding lid for EE04 case — integrates epd_case as ceiling
  2. // z=0 = bottom of flanges; ceiling at z=LID_T (epd_case backplate) or z=FLANGE_H (flat test plate)
  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. difference() {
  88. union() {
  89. // Flat ceiling plate for EPD_ANGLE > 0
  90. color("#004B49")
  91. translate([0, -WALL, FLANGE_H])
  92. rounded_box(OUT_L, OUT_W, LID_T, CORNER_R);
  93. if (EPD_IS_LID)
  94. translate([OUT_L/2 - epd_case_w/2, OUT_W - WALL, LID_T + WALL])
  95. rotate([-EPD_ANGLE, 0, 0])
  96. translate([0, -epd_case_d, 0])
  97. epd_case();
  98. // Y- lip — same rounded_box profile clipped to the Y- wall zone so the
  99. // lip corners match the base exterior corners
  100. color("#004B49")
  101. intersection() {
  102. translate([0, -WALL, FLANGE_H - LIP_H - SLIDE_CLEAR])
  103. rounded_box(OUT_L, OUT_W, LIP_H + SLIDE_CLEAR, CORNER_R);
  104. translate([-0.1, -WALL - 0.1, FLANGE_H - LIP_H - SLIDE_CLEAR - 0.1])
  105. cube([OUT_L + 0.2, WALL + 0.2, LIP_H + SLIDE_CLEAR + 0.2]);
  106. }
  107. }
  108. // FPC cable slot — through flat ceiling plate (test-fit lid only; EPD_IS_LID uses epd_case slot)
  109. translate([PCB_OX + FPC_CX - FPC_NOTCH_W/2,
  110. LID_Y_LEN - 3 - FPC_U_DEPTH + FPC_U_T,
  111. FLANGE_H - 0.1])
  112. cube([FPC_NOTCH_W, FPC_SLOT_W, LID_T + 0.2]);
  113. }
  114. }
  115. // ============================================================
  116. // RENDER
  117. // ============================================================
  118. lid();