]> www.fi.muni.cz Git - things.git/blob - kitchen-bar-hook.scad
switch holder.scad
[things.git] / kitchen-bar-hook.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 = 8;
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(body_h) {
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 // make the top of the clip be at x = 0
44 translate([-bar_h/2-wall, 0, 0])
45         clip(body_h);
46
47 top_len = 55;
48 hook_y = 40;
49 hook_base_w = 12;
50 hook_xoff = 15; // from the top
51 hook_end_l = 2;
52
53 translate([-eps, -bar_w-wall, 0])
54         hull() {
55                 cube([eps, clip_front + bar_w + wall, body_h]);
56                 translate([top_len-eps, 0, 0])
57                 cube([eps, wall, body_h]);
58         }
59
60 hull() {
61         translate([top_len-wall, hook_y, 0])
62                 cube([wall, eps, body_h]);
63         translate([top_len-hook_xoff-hook_base_w, -bar_w-wall, 0])
64                 cube([hook_base_w, eps, body_h]);
65 }
66
67 translate([top_len-wall, hook_y-wall, 0])
68         cube([wall+hook_end_l, wall, body_h]);
69
70