epd_case.scad 2.2 KB

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