chiark / gitweb /
screw-recess-test: break out RecessedScrewCutout_totaldepth (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 11 Feb 2015 21:33:28 +0000 (21:33 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 11 Feb 2015 21:37:17 +0000 (21:37 +0000)
screw-recess-test.scad

index c4c2618..576c216 100644 (file)
@@ -18,13 +18,17 @@ RecessedScrewCutout_defaultrecessdepth_hex = -0.70;
 function RecessedScrewCutout_recessdepth(recessdia, recessdepth_arg) =
   recessdepth_arg >= 0 ? recessdepth_arg : -recessdepth_arg * recessdia;
 
+function RecessedScrewCutout_totaldepth(recessdia, recessdepth_arg) =
+  RecessedScrewCutout_recessdepth(recessdia, recessdepth_arg) +
+  + 0.5*recessdia + 0.1;
+
 module RecessedScrewCutout(shaftdia, recessdia, shaftlen,
         zbelow=1,
         recessdepth_arg=RecessedScrewCutout_defaultrecessdepth_flat) {
   // pass recessdepth_arg=-1 for the default for flat heads
   // pass recessdepth_arg=-1 for the default for flat heads
   recessdepth = RecessedScrewCutout_recessdepth(recessdia, recessdepth_arg);
-  recesstopz = recessdepth + 0.5*recessdia + 0.1;
+  recesstopz = RecessedScrewCutout_totaldepth(recessdia, recessdepth_arg);
   xblocky = shaftdia + 0.1;
 
   translate([0,0,-zbelow]) cylinder(r=shaftdia/2, h=shaftlen+zbelow, $fn=20);