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 c23c9367563383aa174adc6f4f827aa609449160..dd376d6571b5cfec90025f72301fc7d079f3e5ae 100644 (file)
@@ -56,22 +56,25 @@ y_T_r = -tana * sina;
 
 top_r = wall_r - (d_OC_r - 1);
 
 
 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(){
 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
     translate([0, -d_OC_r * r0])
       circle(r = r0);
   }
 }
 
 module CrossSectionDemo(){ ////toplevel
+  color("black") CrossSection(2);
   CrossSection();
   for (rc=[["red", r1],
           ["blue",r0]]) {
   CrossSection();
   for (rc=[["red", r1],
           ["blue",r0]]) {