]> www.fi.muni.cz Git - things.git/blob - mini-arrow-fuselage.scad
generic pulley
[things.git] / mini-arrow-fuselage.scad
1 infty = 300;
2 eps = 0.01;
3
4 fuse_w = 60;
5 fuse_h = 33;
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 front_edge_w = 4;
43
44 module body_cube() {
45         translate([0, -fuse_w/2, 0])
46                 cube([fuse_l, fuse_w, fuse_h]);
47 }
48
49 module body() {
50         // main U-shape
51         difference() {
52                 body_cube();
53                 translate([-eps, -fuse_w/2+wall, wall])
54                         cube([corner_x + 2*eps, fuse_w - 2*wall, fuse_h]);
55                 // round corners
56                 hull() {
57                         translate([corner_x-eps, -fuse_w/2+wall, wall+corner_r])
58                                 cube([corner_l+2*eps, fuse_w - 2*wall, fuse_h]);
59                         for (y = [-1, 1]) scale([1, y, 1])
60                         translate([corner_x-eps, fuse_w/2-wall-corner_r, wall+corner_r])
61                                 rotate([0, 90, 0]) cylinder(r = corner_r, h = corner_l+2*eps);
62                 }
63         };
64
65         
66         // support for center rod
67         for (y = [-1, 1]) scale([1, y, 1]) {
68                 translate([center_rod_x-rod_support_w/2, fuse_w/2-rod_support_l, 0])
69                         cube([rod_support_w, rod_support_l, center_rod_h+rod_support_h_add]);
70                 translate([center_rod_x-rod_support_w/2, fuse_w/2-2*wall, 0])
71                         cube([rod_support_w, wall + eps, fuse_h]);
72         }
73         // support for front rod
74         for (y = [-1, 1]) scale([1, y, 1]) {
75                 intersection () {
76                         body_cube();
77                         translate([front_rod_x, fuse_w/2, 0]) {
78                                 rotate([0, 0, front_rod_angle])
79                                 translate([-rod_support_w/2, -rod_support_l, 0])
80                                         cube([rod_support_w + 3*wall, 2*rod_support_l, front_rod_h+rod_support_h_add]);
81 //                              translate([-rod_support_w/2, -3*wall, 0])
82 //                                      cube([rod_support_w, 6*wall*tan(front_rod_angle), fuse_h]);
83                                 translate([-0.707*front_edge_w, 0, 0])
84                                 rotate([0, 0, -30])
85                                 translate([-front_edge_w, -front_edge_w, 0])
86                                         cube([2*front_edge_w, 2*front_edge_w, fuse_h]);
87                         }
88                 }
89         }
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
113         // front hole
114         translate([front_rod_x-wall, -infty/2,  front_rod_h + rod_support_h_add])
115                 cube(infty);
116 }