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