]> www.fi.muni.cz Git - things.git/blob - ikea-kitchen-bar.scad
switch holder.scad
[things.git] / ikea-kitchen-bar.scad
1 // hook for the aluminium kitchen bar from IKEA
2
3 infty=200;
4 eps=0.01;
5
6 bar_w = 3.5 + 0.7;
7 bar_h = 29.3 + 0.5;
8 bar_to_wall = 27; // incl. the bar itself
9
10 wall = 3.1;
11 upper_overhang = 10.0 - wall;
12 lower_overhang = 2.0;
13
14 body_h = 12;
15
16 clip_front = 5; // stronger than wall for this object
17
18 // coordinates: front end of the bar is the xz plane, centered by the x axis,
19 // +x is the upper part, -x is lower, +y is front
20
21 module clip() {
22         // front part
23         translate([-bar_h/2-wall, 0, 0])
24                 cube([bar_h + 2*wall, clip_front, body_h]);
25         // upper and lower horizontal bars
26         for (x = [-1, 1]) scale([x, 1, 1])
27                 translate([bar_h/2, -bar_w -wall, 0])
28                         cube([wall, bar_w + 2*wall, body_h]);
29         // upper overhang
30         translate([bar_h/2-upper_overhang, -bar_w-wall, 0])
31                 cube([upper_overhang + wall, wall, body_h]);
32         // lower overhang
33         translate([-bar_h/2-wall, -bar_w-wall, 0])
34                 difference() {
35                         cube([lower_overhang + wall, wall, body_h]);
36                         translate([lower_overhang + wall, 2*wall/3, 0])
37                                 rotate([0, 0, -45])
38                                         translate([0, -infty/2, -infty/2])
39                                         cube(infty);
40                 }
41 }
42
43 // holder for the magnetic knife bar based on the above clip
44
45 front_w = 9;
46 screw_hole = 5;
47 bolt_hole = 9;
48 bolt_depth = 4;
49 knifebar_w = 45; // for an alternative design
50 knifebar_w_big = 47.5 + 0.7;
51 knifebar_d = 17.7;
52 screw_l = 8.5;
53
54 /*
55 // first version
56 difference() {
57         union() {
58                 clip();
59                 translate([-bar_h/2-wall, 0, 0])
60                         cube([bar_h + 2*wall, front_w, body_h]);
61         }
62
63         // screw hole
64         translate([0, -infty/2, body_h/2])
65                 rotate([-90, 0, 0])
66                 cylinder(r = screw_hole/2, h=infty, $fn = 6);
67         // bolt hole
68         translate([0, bolt_depth, body_h/2])
69                 rotate([90, 0, 0])
70                 cylinder(r = bolt_hole/2, h=infty, $fn = 6);
71 }
72
73 */
74
75 clip();
76
77 knifebar_x_off = -bar_h/2-wall-8;
78 knifebar_y_off = -knifebar_d + 2*wall;
79 knifebar_rear_wall = 5;
80
81 // top
82 hull() {
83         translate([-bar_h/2-wall, -bar_w -wall, 0])
84                         cube([wall, bar_w + wall + clip_front, body_h]);
85         translate([knifebar_x_off, knifebar_y_off-knifebar_rear_wall, 0])
86                 cube([wall, -knifebar_y_off+wall+knifebar_rear_wall, body_h]);
87         // translate([knifebar_x_off, knifebar_y_off-knifebar_rear_wall, 0])
88         //      cube([wall, knifebar_rear_wall, body_h]);
89 }
90
91 // rear
92 difference() {
93         translate([knifebar_x_off-knifebar_w_big+wall, knifebar_y_off-knifebar_rear_wall, 0])
94                 cube([knifebar_w_big, knifebar_rear_wall, body_h]);
95         translate([knifebar_x_off-knifebar_w_big/2, 0, body_h/2])
96                 rotate([90, 0, 0])
97                         cylinder(r = screw_hole/2, h = infty, $fn = 6);
98 }
99
100 // bottom support to the wall
101 translate([knifebar_x_off-knifebar_w_big+wall, -bar_to_wall, 0])
102         cube([wall, bar_to_wall+knifebar_y_off, body_h]);
103
104
105 /*
106 // the bar itself
107 # translate([knifebar_x_off-knifebar_w_big, knifebar_y_off, 0])
108         cube([knifebar_w_big, knifebar_d, body_h]);
109
110 // wall
111 # translate([-infty/2, -bar_to_wall, 0])
112         cube([infty, eps, body_h]);
113
114 */