epd_case.scad 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Waveshare GDEY0583T81 5.83" ePaper Display Case
  2. // Display slides in from Y-; no Y- side wall
  3. // FPC cable exits toward Y+ then bends 90° toward Z- through backplate slot
  4. include <params.scad>
  5. use <GDEY0583T81.scad>
  6. /* [Preview] */
  7. SHOW_DISP = true;
  8. EPD_EXPLODE = 0; // mm to pull display mockup toward Y- for inspection
  9. CLIP_Z = 0; // mm to remove from Z+ (0 = full model; LIP reveals cavity; LIP+DISP_T reveals floor)
  10. module epd_case() {
  11. color("#004B49") {
  12. difference() {
  13. // Solid case body — open at Y=0 (no Y- wall) by construction
  14. rounded_box(epd_case_w, epd_case_d, epd_case_h, CORNER_R);
  15. // Display cavity: slides in from Y=0; BEZEL_Y extends depth so display seats at Y=BEZEL_Y
  16. translate([WALL, -0.01, WALL])
  17. cube([epd_cav_w, BEZEL_Y + epd_cav_d + DISP_Y_EXTRA + 0.01, DISP_T + TOL]);
  18. // Active area window: straight portion + chamfered top edges
  19. // Extends 0.01 mm into the display cavity to avoid a coplanar face with the mockup
  20. translate([epd_win_x, epd_win_y, WALL + DISP_T - 0.01])
  21. cube([epd_win_w, ACT_D, LIP - CHAM + 0.02]);
  22. hull() {
  23. translate([epd_win_x, epd_win_y, epd_case_h - CHAM])
  24. cube([epd_win_w, ACT_D, 0.01]);
  25. translate([epd_win_x - _cham_xy, epd_win_y - _cham_xy, epd_case_h])
  26. cube([epd_win_w + 2*_cham_xy, ACT_D + 2*_cham_xy, 0.01]);
  27. }
  28. // FPC cable slot — quarter-cylinder swept volume of cable arc from horizontal to vertical.
  29. // Arc center at (Y=DISP_D, Z=WALL−FPC_BEND_R); first-quadrant slice (Y≥DISP_D, Z≥arc_center_z).
  30. // Creates opening through backplate floor and clears Y+ wall material for bend.
  31. translate([_fpc_x1, BEZEL_Y + DISP_D + DISP_Y_EXTRA, WALL - FPC_BEND_R])
  32. intersection() {
  33. rotate([0, 90, 0])
  34. cylinder(r=_fpc_ro, h=_fpc_xw, $fn=32);
  35. cube([_fpc_xw, _fpc_ro + 1, _fpc_ro + 1]);
  36. }
  37. }}
  38. // Display mockup — seated at case origin; EPD_EXPLODE pulls it toward Y-
  39. if ($preview && SHOW_DISP)
  40. color("#F0F0F0")
  41. translate([WALL + TOL, BEZEL_Y + DISP_Y_EXTRA - EPD_EXPLODE, WALL])
  42. GDEY0583T81(fpc_bend_start=0, fpc_bend_r=FPC_BEND_R, fpc_post_clip=2);
  43. }
  44. intersection() {
  45. epd_case();
  46. cube([epd_case_w + 1, epd_case_d + 1,
  47. ($preview && CLIP_Z > 0) ? max(0.01, epd_case_h - CLIP_Z) : epd_case_h + 1]);
  48. }