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 module RecessedScrewCutout(shaftdia, recessdia, shaftlen,
23 recessdepth_arg=RecessedScrewCutout_defaultrecessdepth_flat) {
24 // pass recessdepth_arg=-1 for the default for flat heads
25 // pass recessdepth_arg=-1 for the default for flat heads
26 recessdepth = RecessedScrewCutout_recessdepth(recessdia, recessdepth_arg);
27 recesstopz = recessdepth + 0.5*recessdia + 0.1;
28 xblocky = shaftdia + 0.1;
30 translate([0,0,-zbelow]) cylinder(r=shaftdia/2, h=shaftlen+zbelow, $fn=20);
31 RecessScrewCutout_RecessCylinder(recessdia,zbelow, recessdepth);
33 translate([-recessdia*1.5, -xblocky/2, -zbelow])
34 cube([recessdia*3, xblocky, recesstopz+2+zbelow]);
35 translate([0, -recessdia, recesstopz])
36 rotate([0,135,0]) cube([recessdia, recessdia*2, 10]);
37 RecessScrewCutout_RecessCylinder(recessdia,zbelow, recesstopz+1);
43 translate([-cubexy/2, -cubexy/2, 0])
44 cube([cubexy,cubexy,cubez]);
49 RecessedScrewCutout(tests[0][0],