// allviews corner middle_pin middle_support tee stop top_support // printviews corner:x2 corner:x2,y2 corner:x3,y2 // printviews middle_pin:x2,y2 middle_pin:x3 // printviews middle_support:x2,y2 middle_support:x3 // printviews top_support:y2 // printviews tee:x2 tee:x3 // testviews assembly // viewsopts h2 // viewopts stop h3 include ray=6.5; // radius of the wood stick woodwidth=ray*2; woodheight=ray*2; thick=2; len1=500; width1=400; len2=520; width2=420; // Prevent the large part from moving too much module stop(){ len=140; ww2=woodwidth+thick*4; wh2=woodheight+thick*4; ww4=ww2+ww2-5; difference(){ union(){ cube([len,ww2,wh2]); cube([ww2,ww4,wh2]); translate([len-ww2,0,0]) cube([ww2,ww4,wh2]); } union(){ translate([len/2+20,ww2/2,-1]) cylinder(r=ray+0.1,h=wh2+2,$fn=40); translate([len/2+20,-1,wh2/2]) rotate([-90,0,0]) cylinder(r=2,h=ww2+2+100,$fn=40); translate([len,ww4+1,5]) rotate([0,-30,180]) cube([len,ww4+2,wh2]); translate([0,-1,5]) rotate([0,-30,0]) cube([len,ww4+2,wh2]); } } } module corner(){ len=woodwidth+25; t2=thick*2; difference(){ union(){ cube([len,woodwidth+t2,woodheight+t2]); cube([woodwidth+t2,len,woodheight+t2]); } union(){ tray=thick+ray; translate([thick,tray,tray]) rotate([0,90,0]) cylinder(r=ray,h=len+1,$fn=40); translate([tray,thick,tray]) rotate([-90,0,0]) cylinder(r=ray,h=len+1,$fn=40); translate([len-10,woodwidth/2+thick,0]) cylinder(r=2,h=woodheight+6,$fn=20); translate([woodwidth/2+thick,len-10,0]) cylinder(r=2,h=woodheight+6,$fn=20); } } } module tee(){ len=woodwidth+25; thick=2; t2=thick*2; difference(){ union(){ cube([len,woodwidth+t2,woodheight+t2]); translate([len/2-woodwidth/2-thick,0,0]) cube([woodwidth+t2,len,woodheight+t2]); } union(){ tray=thick+ray; translate([-1,tray,tray]) rotate([0,90,0]) cylinder(r=ray,h=len+2,$fn=40); translate([len/2-woodwidth/2-thick,0,0]) translate([tray,thick,tray]) rotate([-90,0,0]) cylinder(r=ray,h=len+1,$fn=40); translate([len-10,woodwidth/2+thick,0]) cylinder(r=2,h=woodheight+6,$fn=20); translate([len/2,len-10,0]) cylinder(r=2,h=woodheight+6,$fn=20); } } } module middle_pin(){ len=woodwidth+25; thick=2; t2=thick*2; difference(){ ww2 = woodwidth/2; union(){ translate([-len/2,0,0]) cube([len,woodwidth+t2,woodheight+t2]); translate([0,ww2+thick,woodheight+thick]) rotate([0,0,0]) cylinder(r=ray,h=woodwidth+12,$fn=40); } union(){ tray=thick+ray; translate([-len/2-1,tray,tray]) rotate([0,90,0]) cylinder(r=ray,h=len+2,$fn=40); translate([len/2-4,ww2+thick,-1]) cylinder(r=2,h=woodheight+2*thick+2,$fn=20); } } } module middle_support(){ len=woodwidth+25; thick=2; t2=thick*2; difference(){ ww2 = woodwidth/2; wwt2=woodwidth+2*thick; union(){ translate([-len/2,0,0]) cube([len,woodwidth+t2,woodheight+t2]); translate([-wwt2/2,wwt2,0]) cube([wwt2,wwt2,wwt2]); } union(){ tray=thick+ray; translate([-len/2-1,tray,tray]) rotate([0,90,0]) cylinder(r=ray,h=len+2,$fn=40); translate([0,wwt2+tray,-1]) rotate([0,0,0]) cylinder(r=ray+0.25,h=len+2,$fn=40); translate([len/2-4,ww2+thick,-1]) cylinder(r=2,h=woodheight+2*thick+2,$fn=20); } } } module top_support(){ len=woodwidth+25; thick=2; t2=thick*2; difference(){ ww2 = woodwidth/2; wwt2=woodwidth+2*thick; union(){ translate([-len/2,0,0]) cube([len+wwt2,woodwidth+t2,woodheight+t2]); } union(){ tray=thick+ray; translate([-len/2-1,tray,tray]) rotate([0,90,0]) cylinder(r=ray,h=len-1,$fn=40); translate([len/2+wwt2/2,tray,-1]) rotate([0,0,0]) cylinder(r=ray+0.25,h=len+2,$fn=40); translate([len/2-8,ww2+thick,-1]) cylinder(r=2,h=woodheight+2*thick+2,$fn=20); } } } module main_view(view){ if (view=="stop"){ stop(); }else if (view=="corner"){ corner(); }else if (view=="middle_pin"){ middle_pin(); }else if (view=="middle_support"){ middle_support(); }else if (view=="top_support"){ top_support(); }else if (view=="tee"){ tee(); }else if (view=="assembly"){ } }