9. Correction
Correction Exercise 2:
//Exercise 2
$fn = 100;
translate([0,-20,0]) cube([20,20,2]);
translate([0,-20,0]) rotate([0,-90,0]) cube([20,20,2]);
Correction Exercise 3:
//Exercise 3
$fn = 100;
difference(){
translate([0,-20,0]) cube([20,20,2]);
#translate([10,-10,-5]) cylinder(10,2,2);
}
difference(){
translate([0,-20,0]) rotate([0,-90,0]) cube([20,20,2]);
#translate([-5,-10,10]) rotate([0,90,0]) cylinder(10,2,2);
}
Correction Final Exercises:
//Final Exercise 1
module Base(){
difference(){
cube([20,20,2]);
translate([10,10,-5]) cylinder(10,2,2);
}
}
union(){
translate([0,-20,0]) Base();
translate([0,-20,0]) rotate([0,-90,0]) Base();
}
//Final Exercise 2
$fn = 100;
//global variables
hauteur = 3;
rayon = 19;
module ring(h,r){
difference(){
cylinder(h,r+0.8,r+0.8);
translate([0,0,-1]) cylinder(hauteur+2,r*0.7,r*0.7);
}
}
module Text(){
linear_extrude(height=1) union() {
translate([-2,0,0])resize([4.7,27])rotate([0,0,90])offset(0.7) text("Great","Arial:style=Bold");
translate([5,0,0])resize([4.7,27])rotate([0,0,90])offset(0.7) text("Tuto","Arial:style=Bold");
}
}
module Base(){
translate([1,-rayon+5,3]) Text()
cylinder(hauteur,19,19);
difference(){
cylinder(hauteur,19,19); //base cylinder
//encrusted text zone
hull(){
translate([-3,-9.5,2.1]) cylinder(1,6,6);
translate([-3,9.5,2.1]) cylinder(1,6,6);
translate([4,9.5,2.1]) cylinder(1,6,6);
translate([4,-9.5,2.1]) cylinder(1,6,6);
}
}
}
//module calls
union(){
translate([rayon,rayon,0]) Base();
translate([-rayon*0.13,rayon,0]) ring(3,4);
}
Leave a Reply