8 tests = [[2 + 0.5, 6 + 1.0, 0, 0 ],
9 [3 + 0.5, 9 + 1.0, 0, 10 ],
10 [4 + 0.5, 10 + 1.0, 0, 25 ],
11 [5 + 0.5, 10 + 1.0, 15, 5 ],
12 [6 + 0.5, 12 + 1.0, 15, 20 ]];
14 last_test = tests[len(tests)-1];
23 module RecessScrewCutout_RecessCylinder(recessdia,zbelow, h){
24 translate([0,0,-zbelow]) cylinder(r=recessdia/2, h=h+1, $fn=40);
27 RecessedScrewCutout_defaultrecessdepth_flat = -0.35;
28 RecessedScrewCutout_defaultrecessdepth_hex = -0.70;
30 function RecessedScrewCutout_recessdepth(recessdia, recessdepth_arg) =
31 recessdepth_arg >= 0 ? recessdepth_arg : -recessdepth_arg * recessdia;
33 function RecessedScrewCutout_totaldepth(recessdia, recessdepth_arg) =
34 RecessedScrewCutout_recessdepth(recessdia, recessdepth_arg) +
35 + 0.5*recessdia + 0.1;
37 module RecessedScrewCutout(shaftdia, recessdia, shaftlen,
39 recessdepth_arg=RecessedScrewCutout_defaultrecessdepth_flat) {
40 // pass recessdepth_arg=-1 for the default for flat heads
41 // pass recessdepth_arg=-1 for the default for flat heads
42 recessdepth = RecessedScrewCutout_recessdepth(recessdia, recessdepth_arg);
43 recesstopz = RecessedScrewCutout_totaldepth(recessdia, recessdepth_arg);
45 translate([0,0,-zbelow]) cylinder(r=shaftdia/2, h=shaftlen+zbelow, $fn=20);
46 RecessScrewCutout_RecessCylinder(recessdia,zbelow, recessdepth);
48 cube([recessdia + 1, shaftdia + 0.1, recesstopz*2 + 1], center=true);
49 translate([0, -recessdia, recesstopz])
50 rotate([0,135,0]) cube([recessdia, recessdia*2, 10]);
51 RecessScrewCutout_RecessCylinder(recessdia,zbelow, recesstopz+1);
56 translate([blockminx, blockmaxx, 0])
57 cube([blockmaxx-blockminx, blockmaxy-blockminy, cubez]);
65 RecessedScrewCutout(t[0],t[1], shaftz+1);
73 translate([t[2], t[3], 0])
74 RecessedScrewCutout(t[0],t[1], shaftz+1);