From: Tomas Mudrunka Date: Mon, 10 Feb 2025 21:22:59 +0000 (+0100) Subject: refaktorace kodu X-Git-Url: http://git.harvie.cz/?a=commitdiff_plain;h=bdb8e62e7fd10b41e12c112a9081687d02c8d8b1;p=mirrors%2FDesigns.git refaktorace kodu --- diff --git a/openscad/planter_modular_b.scad b/openscad/planter_modular_b.scad index 96f2fca..471ed62 100644 --- a/openscad/planter_modular_b.scad +++ b/openscad/planter_modular_b.scad @@ -7,31 +7,33 @@ $fn=6; - diry na zavlahu? */ -module planter(hole=0) { -difference() { - intersection() { +module cavity(hole=0) { + difference() { union() { - cylinder(d2=20, d1=20, h=15); - translate([0,0,-1]) cylinder(d2=17, d1=16.5, h=1); //index - } - union() { - difference() { - cylinder(d2=20, d1=20, h=15); - translate([0,0,1]) cylinder(d2=17, d1=13, h=16); //pothole - translate([0,17.3/2*hole,1]) rotate([0,0,45]) cylinder(d2=12, d1=9.2, h=15, $fn=4); //pothole-join + translate([0,0,1]) cylinder(d2=17, d1=13, h=14); //pothole + translate([0,17.3/2*hole,1]) rotate([0,0,45]) cylinder(d2=12, d1=9.2, h=14, $fn=4); //pothole-join } - translate([-3,0,-2]) scale([1,0.9,1.3]) rotate([0,90,0]) rotate([0,0,30]) cylinder(d1=5, d2=38, h=15); //balcony - translate([0,0,-1]) cylinder(d2=17, d1=16.5, h=1); //index - } + translate([-3,0,-2]) scale([1,0.9,1.3]) rotate([0,90,0]) rotate([0,0,30]) cylinder(d1=5, d2=38, h=15); //balcony clearance } - translate([-3,0,-2]) scale([1,0.9,1.22]) rotate([0,90,0]) rotate([0,0,30]) cylinder(d1=1, d2=34, h=15); //balcony + } +module planter(hole=0, hollow=1) { +difference() { + + if(hollow != -1) union() { + cylinder(d2=20, d1=20, h=15); //main hexagon + translate([0,0,-1]) cylinder(d2=17, d1=16.5, h=1); //index + } + if(hollow != -1) translate([-3,0,-2]) scale([1,0.9,1.22]) rotate([0,90,0]) rotate([0,0,30]) cylinder(d1=1, d2=34, h=15); //balcony + + if(hollow != 0) cavity(hole); +} } -module double() { - translate([0,0,0]) planter(1); - translate([0,17.3,0]) planter(-1); +module double(ho=1) { + translate([0,0,0]) planter(1, hollow=ho); + translate([0,17.3,0]) planter(-1, hollow=ho); } //!planter(); @@ -41,7 +43,14 @@ module double() { //translate([0,-20,0]) planter(); //double(); -scale(5) difference() { - translate([-11,-10,-1]) cube([22,37,16]); - double(); +scale(5) { + difference() { + //translate([-11,-10,-1]) cube([22,37,16]); + translate([0,0,0]) minkowski() { + cube([2,6,0.0000000001], center=true); + hull() double(); + } + double(ho=1); + } + translate([20,0,0]) double(ho=-1); }