// Fixture au bout de la rampe extérieure // allviews bouchon attache // testviews bouchon_shape bouchon_shape_in test_bouchon test_attache assembly include height=34; ray1=18; ray2=5; module bouchon_shape(off,offlen){ r1=ray1+off; r2=ray2+off; union(){ cylinder(r=r1,h=height,$fn=40); translate([0,19,0]) cylinder(r=r1,h=height,$fn=40); translate([-r1,0,0]) cube([5,19+off,height]); translate([0,-r1,0]) cube([27+3,r1*2+19,height]); translate([27+3,0,0]){ diffray=r1-r2; translate([0,-diffray,0]) cylinder(r=r2,h=height,$fn=40); translate([0,19+diffray,0]) cylinder(r=r2,h=height,$fn=40); translate([0,-diffray,0]) cube([r2,19+2*diffray,height]); } translate([30-offlen,r1/2-34/2-off-off/2,0]) cube([17+offlen*2,34+2*off,height]); } } module bouchon(){ difference(){ union(){ difference(){ bouchon_shape(0,0); translate([0,0,2]) bouchon_shape(-2,1); } translate([-3,-3,0]) cube([21,26,15]); } union(){ translate([40,-ray1,12]) rotate([-90,0,0]) cylinder(r=2,h=ray1*2,$fn=40); translate([40,0,height-12]) rotate([-90,0,0]) cylinder(r=2,h=ray1*2,$fn=40); translate([0,0,-1]) cube([20,20,17]); translate([20/2,-4,15/2]) rotate([-90,0,0]) cylinder(r=2,h=28,$fn=40); } } } module attache(){ difference(){ w=19.5; cube([w,25+15,w]); union(){ translate([w/2,8,-1]) cylinder(r=3,h=w+2,$fn=40); translate([w/2,25+15/2,-1]) cylinder(r=1.8,h=w+2,$fn=40); } } } module main_view(view){ if (view=="bouchon"){ bouchon(); }else if (view == "bouchon_shape"){ bouchon_shape(0,0); }else if (view == "bouchon_shape_in"){ bouchon_shape(-2,10); }else if (view == "test_bouchon"){ intersection(){ translate([-30,-30,0]) cube([100,100,5]); translate([0,0,-1.5]) bouchon(); } }else if (view=="attache"){ attache(); }else if (view == "test_attache"){ intersection(){ translate([-30,-30,0]) cube([100,100,1]); translate([0,0,-1.5]) attache(); } }else if (view == "assembly"){ bouchon(); translate([0.25,ray1+1.7,-25]) rotate([90,0,0]) attache(); } }