7 tests = [[4 + 0.5, 10 + 1.0]];
11 module RecessScrewCutout_RecessCylinder(recessdia,zbelow, h){
12 translate([0,0,-zbelow]) cylinder(r=recessdia/2, h=h+1, $fn=40);
15 RecessedScrewCutout_defaultrecessdepth_flat = -0.35;
16 RecessedScrewCutout_defaultrecessdepth_hex = -0.70;
18 function RecessedScrewCutout_recessdepth(recessdia, recessdepth_arg) =
19 recessdepth_arg >= 0 ? recessdepth_arg : -recessdepth_arg * recessdia;
21 function RecessedScrewCutout_totaldepth(recessdia, recessdepth_arg) =
22 RecessedScrewCutout_recessdepth(recessdia, recessdepth_arg) +
23 + 0.5*recessdia + 0.1;
25 module RecessedScrewCutout(shaftdia, recessdia, shaftlen,
27 recessdepth_arg=RecessedScrewCutout_defaultrecessdepth_flat) {
28 // pass recessdepth_arg=-1 for the default for flat heads
29 // pass recessdepth_arg=-1 for the default for flat heads
30 recessdepth = RecessedScrewCutout_recessdepth(recessdia, recessdepth_arg);
31 recesstopz = RecessedScrewCutout_totaldepth(recessdia, recessdepth_arg);
33 translate([0,0,-zbelow]) cylinder(r=shaftdia/2, h=shaftlen+zbelow, $fn=20);
34 RecessScrewCutout_RecessCylinder(recessdia,zbelow, recessdepth);
36 cube([recessdia + 1, shaftdia + 0.1, recesstopz*2 + 1], center=true);
37 translate([0, -recessdia, recesstopz])
38 rotate([0,135,0]) cube([recessdia, recessdia*2, 10]);
39 RecessScrewCutout_RecessCylinder(recessdia,zbelow, recesstopz+1);
45 translate([-cubexy/2, -cubexy/2, 0])
46 cube([cubexy,cubexy,cubez]);
51 RecessedScrewCutout(tests[0][0],