]> www.fi.muni.cz Git - things.git/blob - wing-tube-support.scad
zaves-clip
[things.git] / wing-tube-support.scad
1 eps = 0.01;
2 infty = 100;
3
4 wall = 1.2;
5 thin_wall = 0.6;
6
7 tube_d = 6 + 0.1;
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                 translate([tube_d/2+wall, -wall, 0])
57                         cube([wall, 2*wall, tube_zoff + tube_d/2]);
58         }
59
60         // upper cylinder clip
61         translate([0, -tube_l/2, tube_d/2 + tube_zoff])
62         intersection() {
63                 rotate([-90, 0, 0]) union() {
64                         cylinder(r = tube_d/2 + wall, h = tube_l);
65                         translate([0, 0, tube_l/2 - wall])
66                                 cylinder(r = tube_d/2 + 2*wall,
67                                         h = 2*wall);
68                 }
69                 translate([-tube_d/2-2*wall, 0, 0])
70                         cube([tube_d + 4*wall, tube_l, tube_d]);
71         }
72 }
73
74 module wing_tube_support(tube_zoff) {
75         difference() {
76                 body(tube_zoff);
77                 // main tube
78                 translate([0, -base_l/2-eps, tube_d/2+tube_zoff])
79                 rotate([-90, 0, 0])
80                         cylinder(r = tube_d/2, h = base_l + 2*eps, $fn = 32);
81                 // upper clip
82                 translate([-infty/2, -infty/2, tube_zoff + 5*tube_d/6])
83                         cube(infty);
84
85                 // front-side hole
86                 translate([0.7*base_front, 0, -eps])
87                         scale([1, base_l/base_front, 1])
88                         cylinder(r = base_front/5, h = thin_wall + 2*eps);
89                 // rear-side hole
90                 translate([-0.6*base_rear, 0, -eps])
91                         scale([1, base_l/base_rear, 1])
92                         cylinder(r = base_rear/4, h = thin_wall + 2*eps);
93         }
94 }
95
96 for (q = [-1,1]) {
97         scale([q, 1, 1]) translate([-base_front - 5, 0, 0]) {
98                         wing_tube_support(1.7);
99                 translate([0, -base_l -5, 0])
100                         wing_tube_support(2.8);
101                 translate([0, base_l + 5, 0])
102                         wing_tube_support(0.6);
103         }
104 }