]> www.fi.muni.cz Git - things.git/blob - pulley.scad
small control horn for rc plane
[things.git] / pulley.scad
1 infty = 100;
2 eps = 0.01;
3
4 diameter = 25;
5 thick = 2.5;
6 base_thick = 1.5;
7 d_minus = thick; // cca 45 deg
8
9 center_hole_d = 4.8+0.5;
10 center_hole_d2 = 2.5;
11 side_holes = 5;
12 side_hole_d = 5;
13
14 cut_hole_d = 2;
15 cut_slot = 1;
16
17 module body() {
18         cylinder(r1 = diameter/2, r2 = diameter/2-d_minus/2, h = thick/2 + eps);
19         translate([0, 0, thick/2-eps])
20                 cylinder(r2 = diameter/2, r1 = diameter/2-d_minus/2, h = thick/2 + eps);
21 }
22
23 difference() {
24         body($fn = 128);
25         if (center_hole_d2 > 0) {
26                 translate([0, 0, 0.5])
27                         cylinder(r1 = center_hole_d/2, r2 = center_hole_d/2+0.2, h = thick + 2*eps, $fn = 8);
28                 translate([0, 0, -eps])
29                         cylinder(r = center_hole_d2/2, h = thick + 2*eps, $fn = 128);
30         } else {
31                 translate([0, 0, -eps])
32                         cylinder(r = center_hole_d/2, h = thick + 2*eps, $fn = 128);
33         }
34         if (side_holes > 0) 
35         for (angle = [0:360/side_holes:360]) rotate([0, 0, angle+180/side_holes])
36                 translate([2*diameter/7 - d_minus + center_hole_d/2, 0, -eps])
37                         cylinder(r = side_hole_d/2, h = thick + 2*eps, $fn=128);
38         if (base_thick)
39                 difference() {
40                         translate([0, 0, base_thick])
41                                 cylinder(
42                                         r1 = center_hole_d/2 + base_thick,
43                                         r2 = diameter/2-d_minus/2,
44                                         h = thick-base_thick+eps, $fn = 128);
45                         translate([0, 0, base_thick-eps])
46                                 cylinder(r1 = center_hole_d/2 + base_thick,
47                                         r2 = center_hole_d/2 + base_thick/2,
48                                         h = thick - base_thick + eps, $fn = 128);
49                 }
50         if (cut_hole_d) {
51                 translate([diameter/3-cut_hole_d/2, 0, -eps])
52                         cylinder(r = cut_hole_d/2, h = thick + 2*eps, $fn =128);
53                 translate([diameter/2-d_minus/2, -cut_slot/2, -eps])
54                         cube([diameter/2, cut_slot, thick + 2*eps]);
55         }
56 }