]> www.fi.muni.cz Git - things.git/blob - wing-tube-support.scad
908a7b2c230b54ea01bfeb9b0a8db60443d53de4
[things.git] / wing-tube-support.scad
1 eps = 0.01;
2 infty = 100;
3
4 wall = 1.5;
5 thin_wall = 0.6;
6
7 tube_d = 6;
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() {
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([thin_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])
62                         cylinder(r = tube_d/2 + thin_wall, h = tube_l);
63                 translate([-tube_d/2-thin_wall, 0, 0])
64                         cube([tube_d + 2*thin_wall, tube_l, tube_d]);
65         }
66 }
67
68 difference() {
69         body();
70         // main tube
71         translate([0, -base_l/2-eps, tube_d/2+tube_zoff])
72         rotate([-90, 0, 0])
73                 cylinder(r = tube_d/2, h = base_l + 2*eps);
74         // upper clip
75         translate([-infty/2, -infty/2, tube_zoff + 5*tube_d/6])
76                 cube(infty);
77
78         // front-side hole
79         translate([0.6*base_front, 0, -eps])
80                 scale([1, base_l/base_front, 1])
81                 cylinder(r = base_front/4, h = thin_wall + 2*eps);
82         // rear-side hole
83         translate([-0.6*base_rear, 0, -eps])
84                 scale([1, base_l/base_rear, 1])
85                 cylinder(r = base_rear/4, h = thin_wall + 2*eps);
86 }