]> www.fi.muni.cz Git - things.git/blob - scooter.scad
808 camera lens holder for 9g servo
[things.git] / scooter.scad
1 infty = 50;
2 eps = 0.01;
3
4 wall = 2;
5
6 led_d = 5 + 0.5;
7 led_l = 3;
8 led_d1 = 7 + 0.3; // sirsi cast LEDky
9 led_l1 = 3; // prostor pro vlozeni LEDky
10
11 led_angle_pitch = 36.6 - 10;
12
13 tube_inner_d = 23;
14 tube_depth = 8;
15 top_h = 17;
16
17 module led() {
18         color("red") {
19                 cylinder(r = led_d/2, h = led_l);
20                 translate([0, 0, led_l]) sphere(led_d/2);
21                 translate([0, 0, -led_l1]) cylinder(r=led_d1/2, h=led_l1+eps);
22         };
23 /*
24         color("gray") {
25                 translate([0, 0, -led_l1]) cylinder(r=led_d1/2, h=led_l1-wall+eps);
26         }
27 */
28 }
29
30
31 module bottom_body() {
32         cylinder(r = tube_inner_d/2 - wall/2, h = tube_depth+eps);
33         for (ang = [0:30:360])
34                 rotate([0, 0, ang])
35                 translate([tube_inner_d/2 - wall/2, 0, -eps])
36                         cylinder(r = wall/2, h = tube_depth + 3*eps, $fn = 4);
37 }
38
39 module bottom() {
40         difference() {
41                 bottom_body();
42                 translate([0, 0, -eps])
43                         cylinder(r = tube_inner_d/2 - 3*wall/2, h = tube_depth + 3*eps);
44         }
45 }
46
47 module top_body() {
48         hull() {
49                 cylinder(r = tube_inner_d/2 + wall, h = wall);
50                 rotate([0, led_angle_pitch, 0])
51                         translate([0, 0, top_h])
52                         cylinder(r = led_d/2 + wall, h = eps);
53         }
54 }
55
56
57 module top() {
58         difference() {
59                 top_body();
60                 rotate([0, led_angle_pitch, 0])
61                         translate([0, 0, top_h-led_l])
62                         difference() {
63                                 # led();
64                                 for (a = [0:60:360])
65                                         rotate([0, 0, a])
66                                         translate([0, led_d1/2, -led_l1-eps])
67                                         cylinder(r1 = wall/3, h = led_l1+3*eps, r2 = 0);
68                         }
69                 hull() {
70                         translate([0, 0, -eps])
71                                 cylinder(r = tube_inner_d/2-3*wall/2, h = eps);
72                         rotate([0, led_angle_pitch, 0])
73                                 translate([0, 0, top_h-led_l-led_l1])
74                                         cylinder(r = led_d1/2, h = eps);
75                 };
76         };
77 }
78
79 module main() {
80         rotate([0, -led_angle_pitch, 0]) {
81                 translate([0, 0, -tube_depth])
82                         bottom();
83                 top();
84         }
85 }
86
87 /* // preview
88 difference() {
89         main();
90         translate([0, 0, -infty/2])
91                 rotate([0, 0, 45])
92                 cube(infty);
93         translate([0, 0, -infty/2])
94                 cube(infty);
95 }
96 */
97
98 rotate([0, 180, 0]) main();
99