width = 20; height = 25; length = 205; rounding = 4.5; buttDepth = 17; buttHeight = 65; buttCutoutLength = 80; buttDiagLength = 120; translate([0,0,length]) rotate([0,90,0]) stock(); module stock(){ difference(){ union(){ shaft1(length,width,height,rounding, buttCutoutLength, rounding+5); translate([length-buttDepth,0,rounding]) butt(buttHeight-rounding,width,buttDepth); translate([length-buttCutoutLength-10,0,height/2]) rotate([0,-30,0]) shaft2(buttDiagLength,width,height-(rounding+5),rounding); bottomCorner(width,-30,rounding); } translate([0,(width-14)/2,(height-14)/2]) cube([121,14,14]); translate([length,0,0]) cube([30,30,buttHeight+100]); translate([length-10-rounding,0,65]) round_edge2(width,rounding, 30); } } module shaft2(length,width,height,rounding){ intersection(){ cube([length,width,height]); translate([0,width,height]) rotate ([-90,0,0]) round_edge(length, rounding, 100, [0,90,0]); translate([0,0,height]) rotate ([0,0,0]) round_edge(length, rounding, 100, [0,90,0]); } } module butt(height,width,depth){ cube([depth,width,height]); } module shaft1(length, width, height, rounding, cutoutLength, cutoutDepth){ difference() { intersection(){ cube(size = [length,width,height]); translate([0,0,0]) rotate ([90,0,0]) round_edge(length, rounding, 100, [0,90,0]); translate([0,width,0]) rotate ([180,0,0]) round_edge(length, rounding, 100, [0,90,0]); translate([0,width,height]) rotate ([-90,0,0]) round_edge(length, rounding, 100, [0,90,0]); translate([0,0,height]) rotate ([0,0,0]) round_edge(length, rounding, 100, [0,90,0]); } translate([length-cutoutLength,0,height-cutoutDepth]) cube([cutoutLength,width,height]); } } //use with intersection module round_edge(length, radius, blocksize, orientation){ //cylinder and three cuboids rotate(orientation) translate([radius,radius,0]) union() { cylinder(h=length, r=radius); translate([-radius,0,0]) cube([blocksize, blocksize, length]); translate([0, -radius,0]) cube([blocksize, blocksize, length]); cube([blocksize, blocksize, length]); } } module round_edge2(length, radius, angle){ difference(){ cube([20,length,20]); translate([10,-1,10]) rotate([-90,0,0]) cylinder(h=length+2,r=radius); translate([10-radius,-1,0]) cube([radius*2,length+2,10]); translate([10,-1,10]) rotate([0,270-angle,0]) translate([-radius,0,0]) cube([radius*2,length+2,10]); translate([0,-1,0]) cube([8,length+2,8]); } }