]> www.fi.muni.cz Git - things.git/blob - mini-arrow-fuselage.scad
Mini arrow fuselage components
[things.git] / mini-arrow-fuselage.scad
1 infty = 300;
2 eps = 0.01;
3
4 fuse_w = 60;
5 fuse_h = 30;
6
7 fuse_l = 132;
8
9 wall = 2;
10
11 rod_d = 3;
12 rod_l = 10.5;
13
14 // center rod
15 center_rod_h = fuse_h - 21;
16 center_rod_x = 78;
17
18 rod_support_w = rod_d + 2*wall;
19 rod_support_l = rod_l + wall;
20 rod_support_h_add = rod_d;
21
22 // front rod
23 front_rod_x = 121.5;
24 front_rod_h = fuse_h - 19;
25 front_rod_angle = 35; // from the Y axis
26
27 // cable_hole
28 cable_hole_x = 100;
29 cable_hole_w = 25;
30 cable_hole_h = 10;
31
32 // corner radius
33 corner_r = 10;
34 corner_l = fuse_l - 21;
35 corner_x = fuse_l - corner_l;
36
37 // top window
38 top_window_x = corner_x + 3;
39 top_window_l = center_rod_x - 8 - top_window_x;
40 top_window_w = fuse_w - 4*wall;
41
42 module body_cube() {
43         translate([0, -fuse_w/2, 0])
44                 cube([fuse_l, fuse_w, fuse_h]);
45 }
46
47 module body() {
48         // main U-shape
49         difference() {
50                 body_cube();
51                 translate([-eps, -fuse_w/2+wall, wall])
52                         cube([corner_x + 2*eps, fuse_w - 2*wall, fuse_h]);
53                 // round corners
54                 hull() {
55                         translate([corner_x-eps, -fuse_w/2+wall, wall+corner_r])
56                                 cube([corner_l+2*eps, fuse_w - 2*wall, fuse_h]);
57                         for (y = [-1, 1]) scale([1, y, 1])
58                         translate([corner_x-eps, fuse_w/2-wall-corner_r, wall+corner_r])
59                                 rotate([0, 90, 0]) cylinder(r = corner_r, h = corner_l+2*eps);
60                 }
61         };
62
63         
64         // support for center rod
65         for (y = [-1, 1]) scale([1, y, 1]) {
66                 translate([center_rod_x-rod_support_w/2, fuse_w/2-rod_support_l, 0])
67                         cube([rod_support_w, rod_support_l, center_rod_h+rod_support_h_add]);
68                 translate([center_rod_x-rod_support_w/2, fuse_w/2-2*wall, 0])
69                         cube([rod_support_w, wall + eps, fuse_h]);
70         }
71         // support for front rod
72         for (y = [-1, 1]) scale([1, y, 1]) {
73                 intersection () {
74                         body_cube();
75                         translate([front_rod_x, fuse_w/2, 0])
76                                 rotate([0, 0, front_rod_angle]) {
77                                 translate([-rod_support_w/2, -rod_support_l, 0])
78                                         cube([rod_support_w, 2*rod_support_l, front_rod_h+rod_support_h_add]);
79                                 translate([-rod_support_w/2, -3*wall, 0])
80                                         cube([rod_support_w, 6*wall*tan(front_rod_angle), fuse_h]);
81                         }
82                 }
83         }
84         // firewall springs
85         spring_d = 2.5;
86         spring_h = 10;
87         for (y = [-1,1]) scale([1, y, 1])
88                 translate([spring_d/2, fuse_w/2-wall, fuse_h/2-spring_h/2+wall/2])
89                         cylinder(r = spring_d/2, h = spring_h, $fn = 4);
90 }
91
92 difference() {
93         body();
94         // holes for center rods
95         for (y = [-1, 1]) scale([1, y, 1])
96         translate([center_rod_x-rod_d/2, fuse_w/2-10, center_rod_h-rod_d/2])
97                 cube([rod_d, rod_l + eps, fuse_h]);
98         // holes for front rods
99         for (y = [-1, 1]) scale([1, y, 1])
100         translate([front_rod_x, fuse_w/2, front_rod_h-rod_d/2])
101         rotate([0, 0, front_rod_angle])
102         translate([-rod_d/2, -rod_l, 0])
103                 cube([rod_d, 2*rod_l, fuse_h]);
104         // holes for servo cables
105         translate([cable_hole_x, -fuse_w/2-eps, fuse_h])
106                 rotate([-90, 0, 0])
107                 scale([1, 2*cable_hole_h/cable_hole_w, 1])
108                 cylinder(r = cable_hole_w/2, h = fuse_w+2*eps);
109         // top window
110         translate([top_window_x, -top_window_w/2, -eps])
111                 cube([top_window_l, top_window_w, fuse_h]);
112 }