$fn = 100; color("yellow") square([3000,4000]); nb_entree = 4; nb_chambre = 5; nb_sdb2 = 3; nb_sdb = 4; nb_vlx1 = 3; nb_vlx2 = 3; nb_vlx3 = 3; nb = 2 * (nb_entree + nb_vlx1 + nb_chambre + nb_sdb2 + nb_sdb + nb_vlx2 + nb_vlx3); color("black") translate([1000, -500, 0]) text(str("Magnets : ", nb), 150); color("black") translate([1000, -1000, 0]) text(str("Magnet size =~ ", 5000 /nb, " cm"), 150); l = 40; h = 100; module aimant (){ square([l, h]); } module fenetre (largeur, hauteur, nm, nb) { delta = (hauteur - 10 - nb * h) / (nb - 1); color ("white",1) translate([largeur/3, hauteur/2, 4]) text(nm, 75); square([largeur, hauteur]); for (i= [0:nb-1]){ color("red",1) translate([5,5+i*(delta + h),2]) { aimant(); translate ([largeur-10-l,0,0]) aimant(); } } translate([50, 50,0]) color("white", 1) text(str(delta," cm"), 80); } color("green") square ([700, 1300]); translate([50,50,0]) fenetre(600, 1030, "SDB", nb_sdb); color("orange") translate([700,0,0])square([1550, 1300]); translate([2175,50,0]) rotate([0,0,90]) fenetre(1200, 1400, "Chambre", nb_chambre); translate([2250,0,0]) color("green") square ([750, 1300]); translate([2275,50,0]) fenetre(700, 900, "VLX2", nb_vlx2); translate([2400,-1500,1]) fenetre(475, 707, "SDB2", nb_sdb2); translate([3100, 50, 0]) fenetre(900, 1200, "Entrée", nb_entree); translate([1300,-1500,0]) fenetre(700, 900, "VLX1", nb_vlx1); translate([50,2800,0]) fenetre(700, 900, "VLX3", nb_vlx3);