]> www.fi.muni.cz Git - things.git/commitdiff
bonsai pot
authorJan "Yenya" Kasprzak <kas@fi.muni.cz>
Mon, 13 Dec 2021 11:09:01 +0000 (12:09 +0100)
committerJan "Yenya" Kasprzak <kas@fi.muni.cz>
Mon, 13 Dec 2021 11:09:01 +0000 (12:09 +0100)
bonsai-pot-tall.scad [new file with mode: 0644]

diff --git a/bonsai-pot-tall.scad b/bonsai-pot-tall.scad
new file mode 100644 (file)
index 0000000..bb756d8
--- /dev/null
@@ -0,0 +1,80 @@
+infty = 200;
+eps = 0.01;
+
+wall = 2;
+
+body_l = 180;
+body_w1 = 35;
+body_w2 = 40;
+body_h = 130;
+end_scale = 1.5;
+center_hole_d = 5;
+
+bottom_sep = 4;
+bottom_h = 10;
+bottom_leg_z = bottom_h-wall;
+
+leg_w = 5;
+leg_h1 = 12;
+leg_h2 = 6;
+leg_l = bottom_sep + 3*wall;
+leg_off = body_l/2;
+
+$fn = 128;
+
+module main_shape(h, l, w1, w2, s) {
+       hull() {
+               for (x = [-1, 1]) scale ([x, 1, 1])
+               translate([l/2-w1*s/2, 0, 0])
+               scale([s, 1, 1])
+               cylinder(r1 = w1/2, r2 = w2/2, h = h);
+       }
+}
+
+module hollow_main_shape(h, l, w1, w2, s) {
+       difference() {
+               main_shape(h, l+2*wall,
+                       w1+2*wall, w2+2*wall,
+                       s);
+               translate([0, 0, wall])
+               main_shape(h, l, w1, w2, s);
+       }
+}
+
+module bottom_main() {
+       hollow_main_shape(bottom_h, body_l+2*wall+bottom_sep, body_w1+2*wall+bottom_sep, body_w2+2*wall+bottom_sep, end_scale);
+}
+
+module legs() {
+       for (y = [-1, 1]) for (x = [-1, 1]) scale([x, y, 1])
+       translate([leg_off/2, body_w1/2+wall-eps, 0])
+       hull() {
+               cube([leg_w, eps, leg_h1]);
+               translate([0, leg_l-eps, 0])
+               cube([leg_w, eps, leg_h2]);
+       }
+}
+
+module pot() {
+       difference() {
+               hollow_main_shape(body_h, body_l, body_w1, body_w2, end_scale);
+               // center hole
+               translate([0, 0, -eps])
+               cylinder(r = center_hole_d/2, h = wall + 2*eps);
+       }
+       difference() {
+               legs();
+               translate([0, 0, -bottom_leg_z]) bottom_main();
+       }
+}
+
+module bottom() {
+       difference() {
+               bottom_main();
+               translate([0, 0, bottom_leg_z]) legs();
+       }
+}
+
+bottom();
+// translate([0, 0, bottom_h + wall]) pot();
+translate([0, body_w2 + bottom_sep + leg_l + 2*wall, 0]) pot();