]> www.fi.muni.cz Git - things.git/blob - wing-tube-support.scad
0c438f783cc4f606b0e79555e60c6f2e37ca3b0f
[things.git] / wing-tube-support.scad
1 eps = 0.01;
2 infty = 100;
3
4 wall = 1;
5 thin_wall = 0.6;
6
7 tube_d = 6 + 0.3;
8 tube_zoff = 3;
9
10 base_front = 15;
11 base_rear  = 25;
12 base_w = base_front + base_rear;
13 base_l = 15;
14
15 tube_l = base_l/2;
16 base_overhang = 0.9; // factor of base_front, base_r, base_l
17
18 module body(tube_zoff) {
19         // base
20         // scale([1, base_l/base_w, 1])
21         // cylinder(r = base_w/2, h = thin_wall);
22         translate([-base_rear, -base_l/2, 0]) cube([base_w, base_l, thin_wall]);
23
24         // front diagonal supports
25         for (y = [-1,1]) 
26         scale([1, y, 1])  hull() {
27                 translate([base_overhang*base_front-thin_wall/2, base_overhang*base_l/2-thin_wall/2, 0])
28                         cylinder(r = thin_wall/2, h = thin_wall, $fn = 16);
29                 translate([0, tube_l/3-thin_wall/2, 0])
30                         cylinder(r = thin_wall/2, h = tube_zoff + tube_d, $fn = 16);
31         }
32
33         // rear diagonal supports
34         for (y = [-1,1]) 
35         scale([1, y, 1])  hull() {
36                 translate([-base_overhang*base_rear+thin_wall/2, base_overhang*base_l/2-thin_wall/2, 0])
37                         cylinder(r = thin_wall/2, h = thin_wall, $fn = 16);
38                 translate([0, tube_l/3-thin_wall/2, 0])
39                         cylinder(r = thin_wall/2, h = tube_zoff + tube_d, $fn = 16);
40         }
41
42         // under the tube supports
43         for (y = [-1,1]) 
44         scale([1, y, 1])  hull() {
45                 translate([0, base_overhang*base_l/2, 0])
46                         cylinder(r = thin_wall/2, h = thin_wall, $fn = 16);
47                 translate([-thin_wall/2, 0, 0])
48                         cube([thin_wall, tube_l/2, tube_zoff]);
49         }
50
51         // side bottom tube supports
52         for (x = [-1,1])
53         scale([x, 1, 1]) {
54                 translate([tube_d/2, -tube_l/2, 0])
55                         cube([wall, tube_l, tube_zoff + tube_d/2]);
56         }
57
58         // upper cylinder clip
59         translate([0, -tube_l/2, tube_d/2 + tube_zoff])
60         intersection() {
61                 rotate([-90, 0, 0]) union() {
62                         cylinder(r = tube_d/2 + wall, h = tube_l);
63                         translate([0, 0, tube_l/2 - wall/2])
64                                 cylinder(r = tube_d/2 + wall + thin_wall,
65                                         h = wall);
66                 }
67                 translate([-tube_d/2-wall, 0, 0])
68                         cube([tube_d + 2*wall, tube_l, tube_d]);
69         }
70 }
71
72 module wing_tube_support(tube_zoff) {
73         difference() {
74                 body(tube_zoff);
75                 // main tube
76                 translate([0, -base_l/2-eps, tube_d/2+tube_zoff])
77                 rotate([-90, 0, 0])
78                         cylinder(r = tube_d/2, h = base_l + 2*eps);
79                 // upper clip
80                 translate([-infty/2, -infty/2, tube_zoff + 5*tube_d/6])
81                         cube(infty);
82
83                 // front-side hole
84                 translate([0.6*base_front, 0, -eps])
85                         scale([1, base_l/base_front, 1])
86                         cylinder(r = base_front/4, h = thin_wall + 2*eps);
87                 // rear-side hole
88                 translate([-0.6*base_rear, 0, -eps])
89                         scale([1, base_l/base_rear, 1])
90                         cylinder(r = base_rear/4, h = thin_wall + 2*eps);
91         }
92 }
93
94 for (q = [-1,1]) {
95         scale([q, 1, 1]) translate([-base_front - 5, 0, 0]) {
96                         wing_tube_support(1.7);
97                 translate([0, -base_l -5, 0])
98                         wing_tube_support(2.8);
99                 translate([0, base_l + 5, 0])
100                         wing_tube_support(0.6);
101         }
102 }