chiark / gitweb /
screw-recess-test: make shaftlen a parameter (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 11 Feb 2015 21:29:45 +0000 (21:29 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 11 Feb 2015 21:36:56 +0000 (21:36 +0000)
screw-recess-test.scad

index 8176878fb2815337598bae9b0fdd759945a311f1..9e3a333a68ee217132bfb1d9cb5d2f986e2131a1 100644 (file)
@@ -15,7 +15,7 @@ module RecessScrewCutout_RecessCylinder(recessdia,zbelow, h){
 RecessedScrewCutout_defaultrecessdepth_flat = -0.35;
 RecessedScrewCutout_defaultrecessdepth_hex = -0.70;
 
-module RecessedScrewCutout(shaftdia, recessdia,
+module RecessedScrewCutout(shaftdia, recessdia, shaftlen,
         recessdepth_arg=RecessedScrewCutout_defaultrecessdepth_flat,
         zbelow=1) {
   // pass recessdepth_arg=-1 for the default for flat heads
@@ -25,7 +25,7 @@ module RecessedScrewCutout(shaftdia, recessdia,
   recesstopz = recessdepth + 0.5*recessdia + 0.1;
   xblocky = shaftdia + 0.1;
 
-  translate([0,0,-zbelow]) cylinder(r=shaftdia/2, h=shaftz+1+zbelow, $fn=20);
+  translate([0,0,-zbelow]) cylinder(r=shaftdia/2, h=shaftlen+zbelow, $fn=20);
   RecessScrewCutout_RecessCylinder(recessdia,zbelow, recessdepth);
   intersection(){
     translate([-recessdia*1.5, -xblocky/2, -zbelow])
@@ -45,7 +45,8 @@ module Test(){
 
 module Hole(){
     RecessedScrewCutout(tests[0][0],
-                       tests[0][1]);
+                       tests[0][1],
+                       shaftz+1);
 }
 
 //Test();