include include module tube(d_in, d_out, h) { difference() { cyl(d=d_out, h=h); cyl(d=d_in, h=h+1); } } module part4() { spur_gear(mod=2,teeth=17, thickness=15); // longer part down(15/2) union() { down(21/2 - 1) cyl(h=21 + 2, d=20, rounding=1/2); down(21+11/2 + 1/2) cyl(h=11, d=20, rounding=1/2); // shaft down(132/2) difference() { cyl(d=18, h=132); down(75/2)left(4/2 + 7) cuboid([4,4,75]); } } //shorter part up(15/2) union() { up(5/2 - 1) cyl(h=5 + 2, d=20, rounding=1/2); up(5 + 1 + 10/2) cyl(h=10, d=20, rounding=1/2); up(5)cyl(h=10, d=18); } } module gear_holes(teeth, indent, h_num, h1, h1d, h2, h2d, cd1, cd2, ch) { difference() { spur_gear(mod=2, teeth=teeth, thickness=15); // middle hole cyl(d=30, h=15); // indent up(15/2) cyl(d=indent, h=7, rounding=0.5); down(15/2) cyl(d=indent, h=7, rounding=0.5); // holes for(i=[0:360/h_num:360]) { zrot(i) left(h1/2) cyl(d=h1d, h=15); zrot(30 + i) left(h2/2) cyl(d=h2d, h=15); } } difference() { cyl(d=cd1, h=15); difference() { cyl(d=cd2, h=15+1); left(50/2 + ch/2) cuboid([50,50,50]); right(50/2 + ch/2) cuboid([50,50,50]); } } } module part6() { spur_gear(mod=2,teeth=18, thickness=15); // longer part down(15/2) union() { down(15/2)cyl(h=15, d=18, rounding1=1); down(4 + 1 + 10/2) cyl(h=10, d=20, rounding=1); difference() { down(4/2) cyl(d=25, h=4, rounding1=1); left(50/2 + 20/2) cuboid([50,50,50]); right(50/2 + 20/2) cuboid([50,50,50]); } } //shorter part up(15/2) union() { up(15/2 - 1) threaded_nut(nutwidth=21, pitch=0, id=5, h=15); cyl(d=28, h=2, rounding=1); up(14 + 5/2) cyl(h=5, d=20, rounding=1/2); up(14 + 5 + 1 + 10/2) cyl(h=10, d=20, rounding=1/2); up(14) cyl(h=20, d=18); } } tube(20,30,4); //part 1 left(50) tube(25,47,12); //part 2 left(100)tube(20,42,12); //part 3 include left(155) part4(); left(250) gear_holes(56, 95, 7, 65, 20, 84, 8, 35, 25, 20); // part 5 left(340) part6(); left(450) gear_holes(73, 125, 6, 82.5, 30, 108, 10, 40, 30, 25); // part 7