//B. Vandeportaele 2019
       
resolutionpart=60;//default value for the constant printerpart, it can be changed through command line using -D
//https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Using_OpenSCAD_in_a_command_line_environment
//use compile.sh to generate the stl files in stl/ subdirectory
resolution=resolutionpart;  //assign the constant value to a variable to be able to test it, even if the constant hasn't been defined in command line
///////////////////////////////////////// 
module texte()
{
    if (resolution>10){ // texte effacé si resolution<=10
    rotate([0,0,180])  {
    translate([-18,-33.5,-3])
    rotate([90,0,0])
    scale([0.7,0.7,1])
        linear_extrude(height =2) {       text( "IUT GEII", font = "Liberation Sans");
        }
    translate([-24,-33.5,-13])
    rotate([90,0,0])
    scale([0.7,0.7,1])        
            linear_extrude(height =2) {       text( "LPRO ROB", font = "Liberation Sans");
            }
    translate([-24,-33.5,-22])
    rotate([90,0,0])
    scale([0.7,0.7,1])        
            linear_extrude(height =2) {       text( "BVDP 2019", font = "Liberation Sans");
            }
        }
    }
}
///////////////////////////////////////// 
l=100;
p=120;
e=0.7;
r=10;


difference(){
    union(){
        translate([-(l-(2*r))/2,-(p-(2*r))/2+20,0])
            minkowski(){
                cube([l-(2*r),p-(2*r),e]);
                cylinder(r=r,h=e,$fn=30);
            }
            cylinder(h=7,d1=15,d2=5,$fn=60);    
            difference(){
                cylinder(h=20,d=65+4,$fn=60);    
                cylinder(h=50,d=65,$fn=60); 
            }
    }
    translate([0,0,-30])
        #cylinder(h=50,d=5,$fn=60);     
 }
translate([-2,50,-34+e]) rotate([90,0,0]) texte();

///////////////////////////////////////// 
