File size: 1,704 Bytes
ebc1b3a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5a083bc
ebc1b3a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5a083bc
ebc1b3a
 
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
import math
import FreeCAD as App
import Part

# A chunky spur gear, built from a closed 2D profile and extruded.
teeth = 18
module = 2.2
thickness = 6.0

pitch_r = module * teeth / 2.0
tip_r = pitch_r + module * 0.9
root_r = pitch_r - module * 1.1
step = 2.0 * math.pi / teeth

points = []
for i in range(teeth):
    a = i * step
    for frac, radius in (
        (-0.46, root_r),
        (-0.40, root_r),
        (-0.35, root_r + (tip_r - root_r) * 0.30),
        (-0.28, root_r + (tip_r - root_r) * 0.82),
        (-0.20, tip_r),
        (0.20, tip_r),
        (0.28, root_r + (tip_r - root_r) * 0.82),
        (0.35, root_r + (tip_r - root_r) * 0.30),
        (0.40, root_r),
        (0.46, root_r),
    ):
        angle = a + frac * step
        points.append(
            App.Vector(math.cos(angle) * radius, math.sin(angle) * radius, 0)
        )
points.append(points[0])

profile = Part.Face(Part.makePolygon(points, True))
gear = profile.extrude(App.Vector(0, 0, thickness))

# Centre bore.
gear = gear.cut(
    Part.makeCylinder(4.5, thickness + 2.0, App.Vector(0, 0, -1.0))
)

# Five lightening holes.
for i in range(5):
    angle = 2.0 * math.pi * i / 5.0 + math.pi / 10.0
    centre = App.Vector(
        math.cos(angle) * pitch_r * 0.62,
        math.sin(angle) * pitch_r * 0.62,
        -1.0,
    )
    gear = gear.cut(Part.makeCylinder(2.8, thickness + 2.0, centre))

plate = Part.show(gear, "GearPlate")
plate.ViewObject.ShapeColor = (0.94, 0.68, 0.32)

hub = Part.makeCylinder(6.8, thickness + 3.0, App.Vector(0, 0, -1.5))
hub = hub.cut(Part.makeCylinder(4.15, thickness + 5.0, App.Vector(0, 0, -2.5)))
hub_obj = Part.show(hub, "Hub")
hub_obj.ViewObject.ShapeColor = (0.27, 0.38, 0.35)