]> www.fi.muni.cz Git - things.git/blob - pulley-elliptical.scad
elliptical pulley
[things.git] / pulley-elliptical.scad
1 infty = 100;
2 eps = 0.01;
3
4 wall = 0.6;             // minimum wall
5 d_x = 25;               // inner diameter in the X axis
6 y_scale = 0.5;          // scale y/x
7 height = 2.5;           // height of the rim
8
9 module half(d_x, y_scale, height) {
10         hull($fn = 128) {
11                 scale([1, (d_x*y_scale+height)/(d_x+height), 1])
12                         cylinder(r = d_x/2 + height/2, h = eps);
13                 translate([0, 0, height/2])
14                         scale([1, y_scale, 1])
15                         cylinder(r = d_x/2, h = eps);
16         }
17 }
18
19 module pulley(d_x, y_scale, height, center_hole_d) {
20         difference() {
21                 union() {
22                         half(d_x, y_scale, height);
23                         translate([0, 0, height]) scale([1, 1, -1])
24                                 half(d_x, y_scale, height);
25                 }
26                 translate([0, 0, -eps])
27                         cylinder(r = center_hole_d/2, h = height + 2*eps);
28         }
29 }
30
31 pulley(d_x = 15, y_scale = 0.5, height=2.5, center_hole_d = 3);
32
33 translate([0, 20, 0])
34 pulley(d_x = 30, y_scale = 0.5, height=2.5, center_hole_d = 5);
35