]> www.fi.muni.cz Git - things.git/blob - vesak-filip-aktovka.scad
vesak pro Fildovu aktovku
[things.git] / vesak-filip-aktovka.scad
1 include <yenyalib.scad>;
2
3 eps = 0.01;
4 infty = 200;
5
6 wall = 10;
7 width = 20;
8
9 top_h = wall * 1.5;
10 top_hole_w = 40 + 1;
11 top_back_h = wall*1.5;
12
13 beam_h = 10;
14
15 bottom_hole_w = 15;
16 bottom_hole_r = 1.2*width;
17 bottom_h = 40;
18
19 front_h = 20;
20
21 module valcova_usec(r, w, h) {
22         intersection() {
23                 tx(-sqrt(r^2 - (h/2)^2)) tz(h/2) rx(-90)
24                         cylinder(r = r, h = w);
25                 cube([r, w, h]);
26         }
27 }
28
29 module vesak() {
30         // top front
31         intersection() {
32                 sx(top_h/wall) cylinder(r = wall, h = width);
33                 cube(infty);
34         }
35
36         // top back
37         ty(-top_hole_w)
38         intersection() {
39                 sx(top_back_h/wall) cylinder(r = wall, h = width);
40                 translate([-infty, -infty, 0]) cube(infty);
41         }
42
43         // top
44         intersection() {
45                 sx(top_h/(top_hole_w+wall))
46                         cylinder(r = top_hole_w + wall, h = width);
47                 ty(-infty) cube(infty);
48         }
49
50         // beam
51         tx(-beam_h) cube([beam_h, wall, width]);
52
53         // bottom
54         tx(-beam_h)
55         intersection() {
56                 sy((bottom_hole_w+2*wall)/bottom_h) cylinder(r = bottom_h, h = width);
57                 tx(-infty) cube(infty);
58         }
59
60         // hook front
61         translate([-beam_h, bottom_hole_w+wall, 0])
62                 cube([front_h, wall, width]);
63
64         // hook rounded top
65         translate([front_h-beam_h, bottom_hole_w+wall, 0])
66                 valcova_usec(bottom_hole_r, wall, width);
67
68         // hook rounded bottom
69         translate([-beam_h, wall, 0])
70                 valcova_usec(bottom_hole_r, bottom_hole_w, width);
71 }
72
73 $fn = 128;
74 round_with() {
75         union() {
76                 for (z = [-1, 1]) sz(z) cylinder(r1 = 1, r2 = 0, h = 2, $fn = 32);
77         }
78         vesak();
79 }
80
81 // round_edges(1) vesak();