-
Notifications
You must be signed in to change notification settings - Fork 0
/
parametric_wheels.scad
61 lines (40 loc) · 1.09 KB
/
parametric_wheels.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// PARAMETRIC GEAR WHEELS
// Parameters
//
// re= external radius
// ri= internal radius
// n=number of gears the wheel has
// d=parameter to control the separation between gears
// h=height of the wheel
module gear_wheel(re,ri,n,d)
{
// Angle difference between middle points of gears
am=360/n;
// Angle difference between middle and ending points of gears
ad=360/((d+1)*n*4);
// Drawing gears
for (i=[0:n-1])
linear_extrude(height = h, center = true, convexity = 10, twist = 0)
polygon(
points=[
[0,0],
[ri*cos(am*i-2*ad),ri*sin(am*i-2*ad)],
[re*cos(am*i-ad),re*sin(am*i-ad)],
[re*cos(am*i),re*sin(am*i)],
[re*cos(am*i+ad),re*sin(am*i+ad)],
[ri*cos(am*i+2*ad),ri*sin(am*i+2*ad)]
],
paths=[[0,1,2,3,4,5]]);
// Drawing internal circle
cylinder(r=ri,h=h,center=true,$fn=100);
}
// example of use
difference()
{
gear_wheel(re=30,ri=25,n=6,d=3,h=8);
union(){
//-- Carved cicle for the Futaba plate
translate([0,0,10]) cylinder(r=21.5/2, center=true,h=20,$fn=100);
//-- Carved circle por the Futaba shart
cylinder(center=true, h=30, r=4.2,$fn=100);
}}