Explorar o código

Simplify cable_cap bore math

Name _bore_h explicitly so _bore_r reads as half the bore height;
drop the no-op translate([0, CAP_WALL - CAP_WALL, 0]).
ZiB hai 4 meses
pai
achega
ef2284c253
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      cable_cap.scad

+ 4 - 4
cable_cap.scad

@@ -142,14 +142,14 @@ module epd_case() {
 // Slip-fit cap — slides over X+ end of case; FPC exits through end-wall slot
 // -------------------------------------------------------------------
 module cable_cap() {
-    _bore_r = (_cap_bore_h-CAP_WALL) / 2;
+    _bore_h = _cap_bore_h - CAP_WALL;
+    _bore_r = _bore_h / 2;
 
     translate([case_w - CAP_ENGAGE + CAP_EXPLODE, -CAP_TOL - CAP_WALL, -CAP_TOL]){
     difference() {
         // Outer shell: hull between two square profiles
         hull() {
-            translate([0, CAP_WALL - CAP_WALL, 0])
-                cube([0.01, _cap_bore_w + 2 * CAP_WALL, _cap_bore_h + CAP_WALL]);
+            cube([0.01, _cap_bore_w + 2 * CAP_WALL, _cap_bore_h + CAP_WALL]);
 
             translate([CAP_ENGAGE + CAP_WALL - 0.01, 0, 0])
                 cube([0.01, _cap_bore_w + 2 * CAP_WALL, _cap_bore_h + CAP_WALL]);
@@ -157,7 +157,7 @@ module cable_cap() {
 
         // Rounded bore
         translate([-0.01, CAP_WALL, CAP_WALL])
-            cube([CAP_ENGAGE-CAP_WALL+0.01, _cap_bore_w, _bore_r*2]);
+            cube([CAP_ENGAGE - CAP_WALL + 0.01, _cap_bore_w, _bore_h]);
         translate([CAP_ENGAGE - _bore_r, _cap_bore_w, _cap_bore_h - _bore_r])
             rotate([90,0,0])
                 cylinder(h=_cap_bore_w - CAP_WALL, r=_bore_r);