]> www.fi.muni.cz Git - things.git/blob - rc-plane-wheel.scad
FT Scout elevator reinforcement: thinner part
[things.git] / rc-plane-wheel.scad
1 infty = 100;
2 eps = 0.01;
3
4 wheel_d = 50;
5 wheel_h = 3;
6 wheel_d1 = wheel_d + wheel_h/2;
7 wheel_thick_outer = 0.5;
8 wheel_thick_inner = 1.5;
9 wheel_rim = 3.5;
10
11 min_wall = 0.5;
12
13 spokes = 5;
14 spoke_w =  3.5;
15 spoke_h = 1.5;
16 spoke_xoff = 10;
17 spoke_r = 15;
18 spoke_center_h = 5;
19
20 center_d = 12;
21 center_d2 = 6;
22 center_hole = 1.2 + 1;
23 center_h = 8;
24
25 module spoke() {
26         intersection() {
27                 translate([-spoke_r, spoke_xoff, 0])
28                 rotate_extrude($fn = 128) {
29                         translate([spoke_r, 0, 0])
30                         polygon(points = [
31                                 [-spoke_w/2, 0], [spoke_w/2, 0],
32                                 [spoke_w/2, min_wall], [min_wall/2, spoke_h],
33                                 [-min_wall/2, spoke_h],
34                                 [-spoke_w/2, min_wall]]
35                         );
36                 }
37                 cylinder(r = wheel_d/2, h = infty);
38                 translate([-infty/2, spoke_xoff, 0]) cube(infty);
39         }
40         hull() {
41                 // front bottom
42                 translate([-spoke_w/2, spoke_xoff, 0])
43                         cube([spoke_w, eps, min_wall]);
44                 // front top
45                 translate([-min_wall/2, spoke_xoff, 0])
46                         cube([min_wall, eps, spoke_h]);
47                 // center bottom
48                 translate([-spoke_w, 0, 0])
49                         cube([2*spoke_w, eps, min_wall]);
50                 // center top
51                 translate([-min_wall/2, 0, spoke_center_h])
52                         cube([min_wall, eps, eps]);
53         }
54                         
55 }
56
57 module body() {
58         // rim
59         difference() {
60                 hull() {
61                         cylinder(r = wheel_d/2, h = wheel_h, $fn = 128);
62                         translate([0, 0, wheel_h/2-eps])
63                                 cylinder(r = wheel_d1/2, h = 2*eps, $fn = 128);
64                 }
65                 translate([0,0,min_wall-eps])
66                         cylinder(r1 = wheel_d/2 - wheel_thick_inner,
67                                 r2 = wheel_d/2 - wheel_thick_outer,
68                                 h = wheel_h - min_wall+ 2*eps);
69                 translate([0,0,-eps])
70                         cylinder(r = wheel_d/2 - wheel_rim,
71                                 h = min_wall+2*eps);
72         }
73
74         // spokes
75         for (a = [0:360/spokes:360-eps]) {
76                 rotate([0, 0, a])
77                 spoke();
78         }
79
80         // center cylinders
81         cylinder(r1 = center_d/2, r2 = center_d2/2, h = center_h/2+eps, $fn = 4*spokes);
82         translate([0, 0, center_h/2])
83                 cylinder(r1 = center_d2/2, r2 = center_hole/2 + 2*min_wall, h = center_h/2, $fn = 4*spokes);
84 }
85
86 module wheel() {
87         difference() {
88                 body();
89                 // center hole
90                 translate([0, 0, -eps])
91                         cylinder(r = center_hole/2, h = center_h + 2*eps);
92         }
93 }
94
95 stopper_d = 6;
96 stopper_h = 3;
97 stopper_hole = 1.2 + 0.5;
98
99 module stopper() {
100         difference() {
101                 cylinder(r1 = stopper_d/2, r2 = stopper_hole/2 + 2*min_wall, h = stopper_h);
102                 translate([0, 0, -eps])
103                         cylinder(r = stopper_hole/2, h = stopper_h + 2*eps);
104         }
105 }
106
107 for (y = [-1, 1]) scale([1, y, 1]) translate([0, wheel_d/2 + 3, 0]) {
108         wheel();
109
110         translate([wheel_d/2 + stopper_d, 0, 0])
111                 stopper();
112 }
113