浏览代码

Calibrate button cutouts and add plunger preview to cpu_case

ZiB 4 月之前
父节点
当前提交
d587f0ea2b
共有 1 个文件被更改,包括 36 次插入 和 8 次删除
  1. 36 8
      cpu_case.scad

+ 36 - 8
cpu_case.scad

@@ -5,10 +5,11 @@
 use <ee04.scad>
 
 /* [Preview] */
-SHOW_BOARD  = true;
-SHOW_LID    = true;
-SHOW_BASE   = true;
-EXPLODE     = 65;      // mm to pull lid out in Y- for inspection (try 40)
+SHOW_BOARD    = true;
+SHOW_LID      = true;
+SHOW_BASE     = true;
+SHOW_PLUNGERS = true;
+EXPLODE       = 65;      // mm to pull lid out in Y- for inspection (try 40)
 
 /* [Board Dimensions — from EE04 STL] */
 PCB_L = 80.00;   // board length  (case_x axis)
@@ -34,9 +35,15 @@ USBC_H      =   4.8;
 USBC_CZ     =   4.4;
 
 // ---- +Y wall: 3× user buttons + 1× reset ----
-BTN_CX      = [48.4, 39.1, 29.8, 20.4];   // PCB-relative case_x centres
-BTN_D       =   4.5;
-BTN_CZ      =   3.7;
+BTN_CX      = [48.4, 39.075, 29.725, 20.425];   // PCB-relative case_x centres
+BTN_D       =   2.3;   // HOLE_D from hat.scad: PLUNGER_D(2.0) + 2×SLIP_CLEAR(0.15)
+BTN_CZ      =   3.85;
+
+/* [Plunger] */
+PLUNGER_D  =  2.0;   // body and head diameter — matches button actuator
+FLANGE_D   =  2.9;   // retention flange OD
+FLANGE_T   =  1.2;   // flange thickness (axial)
+PLUNGER_HEAD_H =  1.5;   // exterior head protrusion past wall face
 
 /* [Case Parameters] */
 WALL          =  2.0;   // wall thickness
@@ -61,7 +68,7 @@ PCB_BOSS_Y2   =  PCB_W - 2.5;
 CLR_XN   =   5.0;   // X- side
 CLR_XP   =  15.0;   // X+ side (JST cable routing)
 CLR_YN   =  15.0;   // Y- side (FPC routing; lid inserts from here)
-CLR_YP   =   0.5;   // Y+ side (snug against button/USB-C wall)
+CLR_YP   =   1.77;  // Y+ side: calibrated contact(1.565) + rest clearance(0.20)
 CLR_LID  =   5.0;   // from tallest component top to lid underside
 
 /* [Sliding Lid] */
@@ -116,6 +123,22 @@ module pcb_boss(px, py, stud=false) {
     }
 }
 
+// Button plunger — origin at hole centre on the interior wall face.
+// At rest: flange flush with interior face, head proud of exterior face.
+module plunger() {
+    color("orange") union() {
+        translate([0, -FLANGE_T, 0])
+            rotate([-90, 0, 0])
+                cylinder(d = PLUNGER_D, h = FLANGE_T + WALL + PLUNGER_HEAD_H, $fn = 32);
+        translate([0, -FLANGE_T, 0])
+            rotate([-90, 0, 0])
+                cylinder(d = FLANGE_D, h = FLANGE_T, $fn = 32);
+        translate([0, WALL, 0])
+            rotate([-90, 0, 0])
+                cylinder(d = PLUNGER_D, h = PLUNGER_HEAD_H, $fn = 32);
+    }
+}
+
 // ============================================================
 //  BASE
 // ============================================================
@@ -264,3 +287,8 @@ if (SHOW_LID)
         lid();
 
 if (SHOW_BOARD) stl_board();
+
+if (SHOW_PLUNGERS)
+    for (bcx = BTN_CX)
+        translate([PCB_OX + bcx, OUT_W - WALL, PCB_Z + BTN_CZ])
+            plunger();