Преглед изворни кода

Flush cap y± faces with case exterior

Deepen y± case recesses by CAP_TOL (to CAP_WALL+CAP_TOL) so the slip
clearance is absorbed into the recess rather than extending the cap
beyond the case outline. Cap bore drops the 2*CAP_TOL offset; cap outer
Y now equals case_d exactly.
ZiB пре 4 месеци
родитељ
комит
aa0a6d9af1
1 измењених фајлова са 11 додато и 11 уклоњено
  1. 11 11
      cable_cap.scad

+ 11 - 11
cable_cap.scad

@@ -46,7 +46,7 @@ CAP_PAD     = 4.0;   // Min cap bore depth
 CAP_ENGAGE  = CAP_PAD + 6.0;   // sleeve engagement length over case exterior (X)
 CAP_WALL    = 1.5;   // sleeve and end-wall thickness
 CAP_TOL     = 0.2;   // per-side slip clearance between bore and case exterior
-CAP_EXPLODE = CAP_PAD + 10;     // preview: mm to pull cap away from case in X+ (0 = seated)
+CAP_EXPLODE = CAP_PAD + 0;     // preview: mm to pull cap away from case in X+ (0 = seated)
 
 // --- Magnetic Strip Locating Lip (rear face) ---
 MAG_L        = 1.772 * 25.4;   // strip length ≈ 45.01 mm
@@ -72,8 +72,8 @@ fpc_pkt_y  = WALL + TOL + (DISP_D - FPC_W) / 2 - FPC_POCKET_PAD;
 fpc_pkt_yw = FPC_W + 2 * FPC_POCKET_PAD;
 
 // Cap derived
-_cap_bore_w  = case_d + 2 * CAP_TOL;   // bore Y width
-_cap_bore_h  = case_h + 2 * CAP_TOL;   // bore Z height
+_cap_bore_w  = case_d - 2*CAP_WALL;                // bore Y width (fits recessed case)
+_cap_bore_h  = case_h + 2*CAP_TOL;                 // bore Z height
 // FPC exit slot spans the full FPC pocket height (pocket floor → cavity ceiling)
 _cap_slot_w  = FPC_W + 1.0;                                       // slot Y width
 _cap_slot_h  = FPC_FLOOR_DROP + DISP_T + TOL + 2 * CAP_TOL;      // slot Z height
@@ -138,11 +138,11 @@ module epd_case() {
 
         // Cap wall recess — step in y- face at X+ end so cap sits flush
         translate([case_w - CAP_ENGAGE + CAP_PAD, -0.01, -0.01])
-            cube([CAP_ENGAGE - CAP_PAD + 0.02, CAP_WALL + 0.01, case_h + 0.02]);
+            cube([CAP_ENGAGE - CAP_PAD + 0.02, CAP_WALL + CAP_TOL + 0.01, case_h + 0.02]);
 
         // Cap wall recess — step in y+ face at X+ end so cap sits flush
-        translate([case_w - CAP_ENGAGE + CAP_PAD, case_d - CAP_WALL, -0.01])
-            cube([CAP_ENGAGE - CAP_PAD + 0.02, CAP_WALL + 0.01, case_h + 0.02]);
+        translate([case_w - CAP_ENGAGE + CAP_PAD, case_d - CAP_WALL - CAP_TOL, -0.01])
+            cube([CAP_ENGAGE - CAP_PAD + 0.02, CAP_WALL + CAP_TOL + 0.01, case_h + 0.02]);
     }
 }
 
@@ -153,7 +153,7 @@ module cable_cap() {
     _bore_h = _cap_bore_h - CAP_WALL;
     _bore_r = _bore_h / 2;
 
-    translate([case_w - CAP_ENGAGE + CAP_EXPLODE, -CAP_TOL - CAP_WALL, 0]){
+    translate([case_w - CAP_ENGAGE + CAP_EXPLODE, 0, 0]){
     difference() {
         // Outer shell: hull between two square profiles
         hull() {
@@ -188,11 +188,11 @@ if (SHOW_CAP)
     color("#1A5C5B")
         intersection() {
             cable_cap();
-            translate([0, -(CAP_TOL + CAP_WALL), -(CAP_TOL + CAP_WALL)])
+            translate([0, 0, -(CAP_TOL + CAP_WALL)])
                 cube([case_w + CAP_WALL + CAP_ENGAGE + CAP_EXPLODE + 1,
                       ($preview && CLIP_Y > 0)
-                          ? max(0.01, case_d + CAP_TOL + CAP_WALL - CLIP_Y)
-                          : case_d + 2 * (CAP_TOL + CAP_WALL) + 1,
-                      case_h + 2 * (CAP_TOL + CAP_WALL) + 1]);
+                          ? max(0.01, case_d - CLIP_Y)
+                          : case_d + 1,
+                      case_h + 2*(CAP_TOL + CAP_WALL) + 1]);
         }