]> www.fi.muni.cz Git - things.git/blob - quasar-triangle.scad
switch holder.scad
[things.git] / quasar-triangle.scad
1 infty = 200;
2 eps = 0.01;
3
4 wall = 1.2;
5 base_w = 4;
6 thin_wall = 0.6;
7 body_h = 4;
8
9 module tbar() {
10         translate([-infty/4, 0, 0]) {
11                 cube([infty/2, base_w, thin_wall]);
12                 cube([infty/2, thin_wall, body_h]);
13                 hull() {
14                         translate([0, 0.7*base_w, 0])
15                                 cube([infty/2, thin_wall, eps]);
16                         translate([0, 0, body_h-eps])
17                                 cube([infty/2, thin_wall, eps]);
18                 }
19         }
20 }
21
22 module side_cube() {
23         translate([-infty/2, 0, -eps])
24                 cube([infty, infty, body_h+2*eps]);
25 }
26
27 module left_side(w, h) {
28         for (i=[0:$children]) {
29                 translate([w/2, 0, 0])
30                 rotate([0, 0, 90+atan(w/(2*h))])
31                 translate([infty/5, 0, 0])
32                         child(i);
33         }
34 }
35
36 module triangle(w, h) {
37         intersection() {
38                 union() {
39                         tbar();
40                         left_side(w, h) tbar();
41                         scale([-1, 1, 1]) left_side(w, h) tbar();
42                 }
43                         side_cube();
44                         left_side(w, h) side_cube();
45                         scale([-1, 1, 1]) left_side(w, h) side_cube();
46         }
47 }
48
49 triangle(50, 80);
50 translate([50, 0, 0])
51 triangle(40, 70);
52 translate([85, 0, 0])
53 triangle(15, 50);
54 translate([105, 0, 0])
55 triangle(15, 70);
56