params.scad 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. // ============================================================
  2. // Shared Parameters
  3. // include <params.scad> in all component files
  4. // ============================================================
  5. include <BOSL2/std.scad>
  6. /* [Design Style] */
  7. EPD_IS_LID = true; // true: epd_case forms the lid ceiling; false: flat ceiling plate
  8. /* [Shared Case] */
  9. WALL = 2.0;
  10. CORNER_R = 2.5;
  11. /* [Display Dimensions — GDEY0583T81] */
  12. DISP_W = 125.4;
  13. DISP_D = 99.5;
  14. DISP_T = 1.2;
  15. ACT_W = 118.78;
  16. ACT_D = 88.22;
  17. /* [EPD Case Parameters] */
  18. EPD_ANGLE = 47; // 0 = flat/inline; 90 = display face coplanar with lid Y+ wall
  19. LIP = 1.5;
  20. TOL = 0.3;
  21. DISP_W_TOL = 0.1; // per-side width tolerance for display pocket (was TOL=0.3; tightened for snug fit)
  22. CHAM = 1.0;
  23. CHAM_ANGLE = 60;
  24. BEZEL_Y = 2.5;
  25. BEZEL_YP = 2.0; // extra Y+ (bottom) bezel padding; shifts display toward Y- within the lid
  26. FPC_BEND_R = 4.0;
  27. DISP_Y_EXTRA = 1.25; // extra pocket depth at Y+ so display can seat 1.25mm further in
  28. /* [EPD Case Derived] */
  29. epd_cav_w = DISP_W + DISP_W_TOL * 2;
  30. epd_cav_d = DISP_D + TOL;
  31. epd_case_w = epd_cav_w + WALL * 2;
  32. epd_case_h = WALL + DISP_T + LIP;
  33. _fpc_x1 = WALL + TOL + DISP_W - 55.47 - 12.50 - 2.5;
  34. _fpc_xw = 12.50 + 5.0;
  35. _fpc_ro = FPC_BEND_R + 0.30 + TOL;
  36. _bend_my = BEZEL_Y + DISP_D + DISP_Y_EXTRA + sqrt(_fpc_ro*_fpc_ro - (FPC_BEND_R - WALL)*(FPC_BEND_R - WALL));
  37. epd_case_d = max(epd_cav_d + WALL + BEZEL_Y, _bend_my + WALL) + BEZEL_YP;
  38. _cham_xy = CHAM * tan(CHAM_ANGLE);
  39. WIN_W_EXTRA = 0.3; // extra clearance added to each side of window vs. active area
  40. epd_win_w = ACT_W + 2 * WIN_W_EXTRA;
  41. epd_win_x = WALL + TOL + (DISP_W - ACT_W) / 2 - WIN_W_EXTRA;
  42. epd_win_y = 3.30 + BEZEL_Y;
  43. /* [Board Dimensions — EE04] */
  44. PCB_L = 80.00;
  45. PCB_W = 41.22;
  46. PCB_T = 1.93;
  47. COMP_MAX_Z = 7.29;
  48. COMP_SIDE_Z = 3.82;
  49. /* [Sliding Lid] */
  50. LID_T = 1.5;
  51. FLANGE_H = 3.0;
  52. FLANGE_W = FLANGE_H * tan(30);
  53. SLIDE_CLEAR = 0.40;
  54. LIP_H = FLANGE_H + 3; // Y- lip height; increase to move split toward lid, decrease toward base
  55. /* [FPC Notch — must match EPD case slot geometry] */
  56. FPC_NOTCH_W = _fpc_xw; // slot X width: cable 12.5 + 2×2.5 mm clearance
  57. FPC_U_T = LID_T;
  58. FPC_SLOT_W = 4.1; // ≈ sqrt(_fpc_ro²−(FPC_BEND_R−WALL)²) at epd_case z=0
  59. /* [+Y Wall Cutouts] */
  60. PWR_CX = 10.3;
  61. PWR_W = 5.0;
  62. PWR_H = 2.5;
  63. PWR_CZ = 3.8;
  64. PWR_COVER_T = 0.6;
  65. USBC_CX = 65.65;
  66. USBC_W = 9.0;
  67. USBC_H = 3.22;
  68. USBC_CZ = 4.31;
  69. USBC_CBL_CLEAR = 1.5;
  70. BTN_CX = [48.4, 39.075, 29.725, 20.425];
  71. BTN_D = 2.3;
  72. BTN_CZ = 3.85;
  73. /* [Plunger] */
  74. PLUNGER_D = 2.0;
  75. FLANGE_D = 2.9;
  76. FLANGE_T = 1.2;
  77. PLUNGER_HEAD_H = 1.5;
  78. /* [CPU Case] */
  79. FLOOR = 2.0;
  80. SCREW_D = 3.2;
  81. SCREW_PILOT_D = 1.7; // M2 self-tapper pilot, SLA resin
  82. BOSS_D = 6.0;
  83. BOSS_H = 2.0;
  84. /* [Locating Studs] */
  85. STUD_CLEAR = 0.10;
  86. STUD_H = PCB_T + 1.0;
  87. PCB_HOLE_D = 2.5; // PCB locating hole diameter
  88. STUD_R = (PCB_HOLE_D - 2*STUD_CLEAR) / 2; // 1.15 mm → 2.3 mm dia stud
  89. /* [PCB Standoff Positions — relative to PCB origin] */
  90. PCB_BOSS_X1 = 2.5;
  91. PCB_BOSS_X2 = PCB_L - 2.5;
  92. PCB_BOSS_Y1 = 2.5;
  93. PCB_BOSS_Y2 = PCB_W - 2.5;
  94. /* [Interior Clearances] */
  95. CLR_XN = 2.0;
  96. CLR_XP = 44.0;
  97. CLR_YN = 15.0;
  98. CLR_YP = 1.77;
  99. CLR_LID = 3.5;
  100. BATT_W = 34.5;
  101. BATT_D = 51.0;
  102. BATT_T = 6.3;
  103. CLR_BATX = 1.5;
  104. CLR_BATY = 1.5;
  105. /* [CPU Case Derived] */
  106. PCB_Z = FLOOR + BOSS_H;
  107. BASE_INNER_H = BOSS_H + COMP_MAX_Z + CLR_LID;
  108. BASE_H = FLOOR + BASE_INNER_H;
  109. PCB_OX = WALL + CLR_XN;
  110. PCB_OY = WALL + CLR_YN;
  111. CAV_L = CLR_XN + PCB_L + CLR_XP;
  112. CAV_W = CLR_YN + PCB_W + CLR_YP;
  113. OUT_L = CAV_L + 2*WALL;
  114. OUT_W = CAV_W + 2*WALL;
  115. LID_H = FLANGE_H + LID_T;
  116. LID_Y_LEN = CAV_W;
  117. // FPC alignment — derived from EPD case geometry (replaces hardcoded values in old cpu_case)
  118. FPC_CX = OUT_L/2 - epd_case_w/2 + (_fpc_x1 + _fpc_xw/2) - PCB_OX;
  119. FPC_U_DEPTH = FPC_U_T - WALL - 3 + (epd_case_d - (BEZEL_Y + DISP_D));
  120. /* [Shared Helper] */
  121. // Corner-anchored box (origin at the -X,-Y,-Z corner) with rounded vertical edges,
  122. // matching the pre-BOSL2 hull-of-cylinders convention used throughout this project.
  123. module rounded_box(l, w, h, r) {
  124. cuboid([l, w, h], rounding=r, edges="Z", anchor=BOTTOM+FRONT+LEFT, $fn=32);
  125. }