8 tests = [[2 + 0.5, 6 + 1.0, 4, -4 ],
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, 17, 4 ],
12 [6 + 0.5, 12 + 1.0, 17, 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,
31 recessdepth_arg=RecessedScrewCutout_defaultrecessdepth_flat) =
32 recessdepth_arg >= 0 ? recessdepth_arg : -recessdepth_arg * recessdia;
34 function RecessedScrewCutout_totaldepth(recessdia,
35 recessdepth_arg=RecessedScrewCutout_defaultrecessdepth_flat) =
36 RecessedScrewCutout_recessdepth(recessdia, recessdepth_arg) +
37 + 0.5*recessdia + 0.1;
39 module RecessedScrewCutout(shaftdia, recessdia, shaftlen,
41 recessdepth_arg=RecessedScrewCutout_defaultrecessdepth_flat) {
42 // pass recessdepth_arg=-1 for the default for flat heads
43 // pass recessdepth_arg=-1 for the default for flat heads
44 recessdepth = RecessedScrewCutout_recessdepth(recessdia, recessdepth_arg);
45 recesstopz = RecessedScrewCutout_totaldepth(recessdia, recessdepth_arg);
47 translate([0,0,-zbelow]) cylinder(r=shaftdia/2, h=shaftlen+zbelow, $fn=20);
48 RecessScrewCutout_RecessCylinder(recessdia,zbelow, recessdepth);
50 cube([recessdia + 1, shaftdia + 0.1, recesstopz*2 + 1], center=true);
51 translate([0, -recessdia, recesstopz])
52 rotate([0,135,0]) cube([recessdia, recessdia*2, 10]);
53 RecessScrewCutout_RecessCylinder(recessdia,zbelow, recesstopz+1);
59 h = RecessedScrewCutout_totaldepth(t[1]) + 3;
61 translate([-blocksz/2, -blocksz/2, 0])
62 cube([blocksz, blocksz, h]);
63 RecessedScrewCutout(t[0],t[1], h+1);
69 translate([t[2], t[3], 0])