Ajout bibliothèque

This commit is contained in:
Matthieu Dubuget 2018-11-18 14:13:12 +01:00
parent 726278f968
commit 4f20574a91

112
bibli-tetris.scad Normal file
View File

@ -0,0 +1,112 @@
ep = 20;
prof = 200;
lb = 330;
hb = 240;
l = 1150;
module planche (longueur, horizontale = true){
color([0.878,0.694,0.133])
translate([horizontale?0:ep,0,0])
rotate([0,horizontale?0:-90,0])
cube([longueur,prof, ep]);
}
module boite(largeur, hauteur){
planche(largeur);
translate([0,0,hauteur-ep]) planche(largeur);
#translate([0,0,ep]) planche(hauteur - 2 * ep,false);
#translate([largeur-ep,0,ep]) planche(hauteur-2*ep,false);
echo("2 × ", largeur, " mm");
echo("2 × ", hauteur - 2 * ep, "mm");
}
module l (largeur,h,w){
h2 = (2*h-3*ep)/2;
planche(largeur);
translate ([w-ep,0,h-ep/2]) planche(largeur-w+ep);
translate ([0,0,2*h-ep]) planche(w);
translate([0,0,ep]) planche(2*(h-ep),false);
translate([largeur-ep,0,ep]) planche(h2,false);
translate([w-ep,0,h+ep/2]) planche(h2,false);
}
boite(lb,hb);
translate([l-lb,0,0]) boite(lb, hb);
translate([0,0,hb]) boite(l,hb);
translate([0,0,hb*2]){
boite(lb,hb);
translate([l-lb,0,0]) boite(lb, hb);
};
translate ([0,0,hb*3]) boite(l,hb);
translate([0,0,hb*4]){
boite(hb,lb);
translate([l-hb,0,0]) boite(hb, lb);
};
translate ([0,0,hb*4+lb]) boite(l,hb);
color([1,0,0]) {
translate([1150,0,0]) planche(1930, false);
translate([1150-920,0,1930]) planche(920+ep);
translate([1150-920,0,1530]) planche(400,false);
translate ([0,0,1530]) planche(1150-920);
};
*rotate([90,0,0])
translate ([1500,0,0])
{
cube([1328,457,ep]);
color([0,0,0]) translate([0,-60,30])text("1348 × 457",50);
translate([0,500,0]){
cube([2499,537,ep]);
color([0,0,0]) translate([0,-60,30])text("2499 × 537",50);
}
translate([0,1100,0]){
cube([1166,1222,ep]);
color([0,0,0]) translate([0,-60,30])text("1166 × 1222",50);
}
translate([1500,0,0]){
cube([345,203,ep]);
color([0,0,0]) translate([0,-60,30])text("345 × 203",50);
}
*translate([1900,0,0]) cube([894,251,ep]);
translate([1500,1100,0]){
cube([800,203,ep]);
color([0,0,0]) translate([0,-60,30])text("800 × 203",50);
}
translate([0,0,1])
color([0,0,1]){
for (i = [0:5]){
translate([0,1100 + i * (prof + 3), 0]) planche(1150);
}; // 6 × 1150
for (j=[0:1]){
for (i=[0:5]){
translate ([i * (330 + 3),500 + j * (prof + 3) ,0])
planche(330);
};
for (i=[0:1]){
translate([i * (200 + 3) + 6 * (330 + 3), 500 + j * (prof + 3),0]) planche(200);
};
}; // 12 × 330 ET 4 × 200
for (j=[0:1]){
for (i = [0:5]){
translate([i * (200 + 3),j * (prof + 3),0]) planche(200);
};
}; // 12 × 200
translate([1500,0,0]) planche(200);
translate([1500,1100,0]) planche(200);
translate([0,-200,0])
text("total : 6 × 1150 + 12 × 330 + 18 × 200",50);
};
};