// allviews base basehaut // testviews testarriere testavant testbase assemblage include length=40; width1=14.5; width2=21; height1=3.5; slot=3.5; height2=height1+slot+2; module attach(add,addh){ w2=add+2; translate([15-add,width2/2-w2,0]) cube([10+2*add,w2*2,height1+addh]); } module basehaut(){ difference(){ cube ([length,width2,height1]); union(){ translate([length-7,width2/2,-1]){ translate([0,0,2]) cylinder(r=9.8/2,h=10,$fn=40); cylinder(r=3,h=10,$fn=20); } translate([0,0,-1]) attach(0.2,2); } } t=(width2-width1)/2; offl1=10; l1=length-offl1; translate([offl1,0,0]) cube ([l1,t,height2]); translate([offl1,width2-t,0]) cube([l1,t,height2]); t2 = t+2; h2 = height2-slot-height1; translate([offl1,0,height1+slot]) cube ([l1,t2,h2]); translate([offl1,width2-t2,height1+slot]) cube ([l1,t2,h2]); intersection(){ cube([10,width2,10]); translate([0,width2/2-2,1.5]) rotate([0,45,0]) cube([4,4,4]); } } module base(){ h1=4; w1=(width2-10)/2; difference(){ translate([length-30,w1,0]) cube([30,width2-2*w1,h1]); translate([length-7,width2/2,-1]){ cylinder(r=4.2,h=h1+2,$fn=20); } } translate([0,0,h1]) attach(0,0); } module main_view(view){ if (view=="base"){ base(); }else if (view=="basehaut"){ basehaut(); }else if (view=="testavant"){ intersection(){ translate([length-15,-2,-1]) cube([15,width2+4,height2+10]); basehaut(); } }else if (view=="testbase"){ intersection(){ union(){ translate([length-12,-2,-1]) cube([10,width2+4,height2+10]); cube([length,width2,0.5]); } base(); } }else if (view=="testarriere"){ //cube([30,30,0.5]); intersection(){ cube([10,width2,height2+10]); basehaut(); } }else if (view=="assemblage"){ translate([0,0,6]) basehaut(); base(); } }