refaktorace kodu
authorTomas Mudrunka <tomas.mudrunka@gmail.com>
Mon, 10 Feb 2025 21:22:59 +0000 (22:22 +0100)
committerTomas Mudrunka <tomas.mudrunka@gmail.com>
Mon, 10 Feb 2025 21:22:59 +0000 (22:22 +0100)
openscad/planter_modular_b.scad

index 96f2fcaf25f281c932b4ef53a4800d2c70800054..471ed62580b391a03ad634263b198516c22fcfc7 100644 (file)
@@ -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);
 }
This page took 0.206252 seconds and 4 git commands to generate.