]> www.fi.muni.cz Git - things.git/blobdiff - sponge-holder.scad
switch holder.scad
[things.git] / sponge-holder.scad
index f54ea65bbf1c70ccd7166ea5e0a957e82ad7faf1..fa0d72972352f5113b2d99e8bf452e59b01a381e 100644 (file)
@@ -1,29 +1,34 @@
 eps = 0.01;
 infty = 200;
 
-v_tube_d = 28.2 - 0.5;
+v_tube_d = 28.2 - 1;
 h_tube_d = 45;
-x_off = 35;
+x_off = 25;
 
-sponge_l = 45; // original size is 85 + 5;
-sponge_w = 58 + 8;
-sponge_h = 30 + 3;
+sponge_l = 55; // original size is 85 + 5;
+sponge_w = 58 + 5;
+sponge_h = 30 + 5;
 
-wall = 1.5;
+wall = 0.90;
 
-clip_h = 15;
+clip_h = 20;
+clip_w = 3.5;
 
 module clip() {
        difference() {
-               cylinder(r = v_tube_d/2 + 2*wall, h = clip_h, $fn = 128);
+               cylinder(r = v_tube_d/2 + clip_w, h = clip_h, $fn = 128);
                translate([0, 0, -eps])
-               cylinder(r = v_tube_d/2 + wall, h = clip_h+2*eps);
-               translate([-infty-v_tube_d/5, -infty/2, -eps])
-                       cube(infty);
+               cylinder(r = v_tube_d/2, h = clip_h+2*eps);
+               intersection() {
+                       rotate([0, 0, -20])
+                               translate([-infty/2, 0, -eps]) cube(infty);
+                       rotate([0, 0, 40])
+                               translate([-infty/2, 0, -eps]) cube(infty);
+               }
        }
-       for (angle = [-1.5*72:72:1.5*72]) rotate([0, 0, angle])
-       translate([v_tube_d/2 + wall, 0, 0])
-               cylinder(r = wall, h = clip_h);
+       // for (angle = [-1.5*72:72:1.5*72]) rotate([0, 0, angle])
+       // translate([v_tube_d/2 + wall, 0, 0])
+       //      cylinder(r = wall, h = clip_h);
 }
 
 module perf_wall(w, h, d, hx, hy, dx, dy, side) {
@@ -53,31 +58,60 @@ module perf_wall(w, h, d, hx, hy, dx, dy, side) {
                cube([w, side, d]);
 }
 
+round_aspect = 0.5;
+module round_side(h, w, wall) {
+       difference() {
+               scale([1, round_aspect, 1])
+                       cylinder(r = w/2 + wall , h = h, $fn = 128);
+               translate([0, 0, -eps])
+                       scale([1, (w/2)*round_aspect/(w/2+wall), 1])
+                       cylinder(r = w/2, h = h + 2*eps, $fn = 128);
+               translate([-infty/2, -infty, -infty/2]) cube(infty);
+       }
+}
+
 module box() {
        for (x = [0, sponge_h + wall]) translate([x + wall/2, 0, (sponge_l+wall)/2])
        rotate([0, 90, 0])
        perf_wall(h = sponge_w + 2*wall, w = sponge_l + wall, d = wall,
-               hx = 20, hy = 10, dx = 2, dy = 3, side=2);
+               hx = 20, hy = 10, dx = 10, dy = 10, side=3);
 
+       for (y = [-1, 1]) scale ([1, y, 1])
+       translate([sponge_h/2+wall, sponge_w/2+wall/2, 0])
+       round_side(h = sponge_l+wall, w = sponge_h, wall = wall);
+/*
        for (y = [-1, 1]) scale ([1, y, 1])
        translate([sponge_h/2+wall, sponge_w/2+wall/2, (sponge_l+wall)/2])
        rotate([90, 0, 0])
        perf_wall(w = sponge_h + 2*wall, h = sponge_l + wall, d = wall,
-               hy = 20, hx = 10, dx = 3, dy = 2, side=2);
+               hy = 20, hx = 10, dx = 10, dy = 10, side=3);
+*/
 
        for (y = [-sponge_w/4, 0, sponge_w/4])
-       translate ([0, y, sponge_l])
-               cube([sponge_h + 2*wall, wall, wall]);
+       translate ([0, y, 0])
+       // translate ([0, y, sponge_l])
+               cube([sponge_h + 2*wall, 0.86, 3]);
 }
 
 module side_handlers() {
-       for (y = [-1, 1]) scale ([1, y, 1])
+       for (y=[-1,1]) scale([1, y, 1])
        hull() {
-               translate([0, sponge_w/2, 0])
-                       cube([wall, wall, clip_h]);
-               translate([-v_tube_d/2-x_off, v_tube_d/2+wall, 0])
+               translate([0, sponge_w/2-wall, 0])
+                       cube([wall, 2*wall, clip_h]);
+               translate([-x_off-v_tube_d/2, 0, 0])
+               rotate([0, 0, 34])
+               translate([v_tube_d/2+clip_w-2*wall, -wall, 0])
+                       cube([2*wall, 2*wall, clip_h]);
+       }
+
+/*
+       hull() {
+               translate([0, -sponge_w/2-wall, 0])
+                       cube([wall, 2*wall, clip_h]);
+               translate([-x_off-v_tube_d/2, -v_tube_d/2-clip_w, 0])
                        cube([wall, wall, clip_h]);
        }
+*/
 
 }