chiark / gitweb /
cable-splice-clamp: make plus work; fix wall_x
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Feb 2016 17:00:35 +0000 (17:00 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 13 Feb 2016 17:00:35 +0000 (17:00 +0000)
cable-splice-clamp.scad

index c23c936..dd376d6 100644 (file)
@@ -56,22 +56,25 @@ y_T_r = -tana * sina;
 
 top_r = wall_r - (d_OC_r - 1);
 
+wall_x_r = wall_r / tan(90-alpha);
+
 echo(r0,r1, "ratio",r1/r0);
 
 module CrossSection(plus=0) {
   difference(){
-    polygon([[-0.1,                         y_T_r * r0],
-            [x_T_r * r0,                   y_T_r * r0],
-            [x_B_r * r1,                   y_B_r * r1],
-            [x_B_r * r1 + wall_r * rnom,   y_B_r * r1],
-            [base_r * rnom,                top_r * rnom],
-            [-0.1,                         top_r * rnom]]);
+    polygon([[-0.1,                                y_T_r * r0],
+            [x_T_r * r0,                          y_T_r * r0],
+            [x_B_r * r1,                          y_B_r * r1],
+            [x_B_r * r1 + wall_x_r * rnom + plus, y_B_r * r1],
+            [base_r * rnom                + plus, top_r * rnom],
+            [-0.1,                                top_r * rnom]]);
     translate([0, -d_OC_r * r0])
       circle(r = r0);
   }
 }
 
 module CrossSectionDemo(){ ////toplevel
+  color("black") CrossSection(2);
   CrossSection();
   for (rc=[["red", r1],
           ["blue",r0]]) {