]> www.fi.muni.cz Git - things.git/blobdiff - ikea-kitchen-bar.scad
switch holder.scad
[things.git] / ikea-kitchen-bar.scad
index 1bbb5368837086162aef0a3cd276e609f100a96b..d292598da0b832fabbf0727d195efa1a8348d2c1 100644 (file)
@@ -1,24 +1,27 @@
 // hook for the aluminium kitchen bar from IKEA
 
-infty=100;
+infty=200;
 eps=0.01;
 
-bar_w = 3.5 + 0.5;
+bar_w = 3.5 + 0.7;
 bar_h = 29.3 + 0.5;
+bar_to_wall = 27; // incl. the bar itself
 
 wall = 3.1;
 upper_overhang = 10.0 - wall;
-lower_overhang = 1.5;
+lower_overhang = 2.0;
 
 body_h = 12;
 
+clip_front = 5; // stronger than wall for this object
+
 // coordinates: front end of the bar is the xz plane, centered by the x axis,
 // +x is the upper part, -x is lower, +y is front
 
 module clip() {
        // front part
        translate([-bar_h/2-wall, 0, 0])
-               cube([bar_h + 2*wall, wall, body_h]);
+               cube([bar_h + 2*wall, clip_front, body_h]);
        // upper and lower horizontal bars
        for (x = [-1, 1]) scale([x, 1, 1])
                translate([bar_h/2, -bar_w -wall, 0])
@@ -31,7 +34,7 @@ module clip() {
                difference() {
                        cube([lower_overhang + wall, wall, body_h]);
                        translate([lower_overhang + wall, 2*wall/3, 0])
-                               rotate([0, 0, -36])
+                               rotate([0, 0, -45])
                                        translate([0, -infty/2, -infty/2])
                                        cube(infty);
                }
@@ -44,7 +47,12 @@ screw_hole = 5;
 bolt_hole = 9;
 bolt_depth = 4;
 knifebar_w = 45; // for an alternative design
+knifebar_w_big = 47.5 + 0.7;
+knifebar_d = 17.7;
+screw_l = 8.5;
 
+/*
+// first version
 difference() {
        union() {
                clip();
@@ -61,3 +69,46 @@ difference() {
                rotate([90, 0, 0])
                cylinder(r = bolt_hole/2, h=infty, $fn = 6);
 }
+
+*/
+
+clip();
+
+knifebar_x_off = -bar_h/2-wall-8;
+knifebar_y_off = -knifebar_d + 2*wall;
+knifebar_rear_wall = 5;
+
+// top
+hull() {
+       translate([-bar_h/2-wall, -bar_w -wall, 0])
+                       cube([wall, bar_w + wall + clip_front, body_h]);
+       translate([knifebar_x_off, knifebar_y_off-knifebar_rear_wall, 0])
+               cube([wall, -knifebar_y_off+wall+knifebar_rear_wall, body_h]);
+       // translate([knifebar_x_off, knifebar_y_off-knifebar_rear_wall, 0])
+       //      cube([wall, knifebar_rear_wall, body_h]);
+}
+
+// rear
+difference() {
+       translate([knifebar_x_off-knifebar_w_big+wall, knifebar_y_off-knifebar_rear_wall, 0])
+               cube([knifebar_w_big, knifebar_rear_wall, body_h]);
+       translate([knifebar_x_off-knifebar_w_big/2, 0, body_h/2])
+               rotate([90, 0, 0])
+                       cylinder(r = screw_hole/2, h = infty, $fn = 6);
+}
+
+// bottom support to the wall
+translate([knifebar_x_off-knifebar_w_big+wall, -bar_to_wall, 0])
+       cube([wall, bar_to_wall+knifebar_y_off, body_h]);
+
+
+/*
+// the bar itself
+# translate([knifebar_x_off-knifebar_w_big, knifebar_y_off, 0])
+       cube([knifebar_w_big, knifebar_d, body_h]);
+
+// wall
+# translate([-infty/2, -bar_to_wall, 0])
+       cube([infty, eps, body_h]);
+
+*/