瀏覽代碼

Taper cap walls toward X- open edge with square corners throughout

Replaces rounded outer shell with a hull between two square profiles:
thin-wall (CAP_TIP) at the open end, full-wall (CAP_WALL) at the closed
end. Adds CAP_TIP parameter (default 0.8 mm) to control minimum edge
thickness.
ZiB 4 月之前
父節點
當前提交
0ff6e50052
共有 1 個文件被更改,包括 14 次插入 和 9 次删除
  1. 14 9
      cable_cap.scad

+ 14 - 9
cable_cap.scad

@@ -44,6 +44,7 @@ SHOW_CAP    = true;   // show cap in preview
 CAP_ENGAGE  = 8.0;   // sleeve engagement length over case exterior (X)
 CAP_ENGAGE  = 8.0;   // sleeve engagement length over case exterior (X)
 CAP_WALL    = 1.5;   // sleeve and end-wall thickness
 CAP_WALL    = 1.5;   // sleeve and end-wall thickness
 CAP_TOL     = 0.2;   // per-side slip clearance between bore and case exterior
 CAP_TOL     = 0.2;   // per-side slip clearance between bore and case exterior
+CAP_TIP     = 0.8;   // minimum wall thickness at X- (open) edge after taper
 CAP_EXPLODE = 5;     // preview: mm to pull cap away from case in X+ (0 = seated)
 CAP_EXPLODE = 5;     // preview: mm to pull cap away from case in X+ (0 = seated)
 
 
 // --- Magnetic Strip Locating Lip (rear face) ---
 // --- Magnetic Strip Locating Lip (rear face) ---
@@ -70,9 +71,8 @@ fpc_pkt_y  = WALL + TOL + (DISP_D - FPC_W) / 2 - FPC_POCKET_PAD;
 fpc_pkt_yw = FPC_W + 2 * FPC_POCKET_PAD;
 fpc_pkt_yw = FPC_W + 2 * FPC_POCKET_PAD;
 
 
 // Cap derived
 // 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_outer_r = CORNER_R + CAP_TOL + CAP_WALL;     // outer corner radius
+_cap_bore_w  = case_d + 2 * CAP_TOL;   // bore Y width
+_cap_bore_h  = case_h + 2 * CAP_TOL;   // bore Z height
 // FPC exit slot spans the full FPC pocket height (pocket floor → cavity ceiling)
 // 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_w  = FPC_W + 1.0;                                       // slot Y width
 _cap_slot_h  = FPC_FLOOR_DROP + DISP_T + TOL + 2 * CAP_TOL;      // slot Z height
 _cap_slot_h  = FPC_FLOOR_DROP + DISP_T + TOL + 2 * CAP_TOL;      // slot Z height
@@ -140,13 +140,18 @@ module cable_cap() {
     // Translate so case exterior Y=0, Z=0 aligns with bore inside walls
     // Translate so case exterior Y=0, Z=0 aligns with bore inside walls
     translate([case_w - CAP_ENGAGE + CAP_EXPLODE, -CAP_TOL - CAP_WALL, -CAP_TOL - CAP_WALL])
     translate([case_w - CAP_ENGAGE + CAP_EXPLODE, -CAP_TOL - CAP_WALL, -CAP_TOL - CAP_WALL])
     difference() {
     difference() {
-        // Outer shell (rounded to match case corner radius + wall stack)
-        rounded_box(CAP_ENGAGE + CAP_WALL,
-                    _cap_bore_w + 2 * CAP_WALL,
-                    _cap_bore_h + 2 * CAP_WALL,
-                    _cap_outer_r);
+        // Outer shell: hull between two square profiles
+        //   X- (open end): inset to CAP_TIP wall thickness
+        //   X+ (closed end): full CAP_WALL thickness
+        hull() {
+            translate([0, CAP_WALL - CAP_TIP, CAP_WALL - CAP_TIP])
+                cube([0.01, _cap_bore_w + 2 * CAP_TIP, _cap_bore_h + 2 * CAP_TIP]);
+
+            translate([CAP_ENGAGE + CAP_WALL - 0.01, 0, 0])
+                cube([0.01, _cap_bore_w + 2 * CAP_WALL, _cap_bore_h + 2 * CAP_WALL]);
+        }
 
 
-        // Bore — open on X- (entry) side; closed by end wall at X+ (local x = CAP_ENGAGE)
+        // Bore — open on X- side; closes at end wall (local x = CAP_ENGAGE)
         translate([-0.01, CAP_WALL, CAP_WALL])
         translate([-0.01, CAP_WALL, CAP_WALL])
             cube([CAP_ENGAGE + 0.02, _cap_bore_w, _cap_bore_h]);
             cube([CAP_ENGAGE + 0.02, _cap_bore_w, _cap_bore_h]);