-
Notifications
You must be signed in to change notification settings - Fork 0
/
wheel-rotor.kcl
160 lines (141 loc) · 4.15 KB
/
wheel-rotor.kcl
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
// Wheel rotor
// A component of a disc brake system. It provides a surface for brake pads to press against, generating the friction needed to slow or stop the vehicle.
// Define constants
// Base units for this model are in inches
rotorDiameter = 12
rotorInnerDiameter = 6
rotorSinglePlateThickness = 0.25
rotorInnerDiameterThickness = 0.5
lugHolePatternDia = 3
lugSpacing = 114.3 * mm()
rotorTotalThickness = 1
spacerPatternDiameter = 11
spacerDiameter = 0.25
spacerLength = rotorTotalThickness - (2 * rotorSinglePlateThickness)
spacerCount = 16
wheelDiameter = 19
lugCount = 5
yAxisOffset = 0.5
drillAndSlotCount = 5
rotorPlane = {
plane = {
origin = { x = 0, y = yAxisOffset, z = 0 },
xAxis = { x = -1, y = 0, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 0, y = 1, z = 0 }
}
}
fn lugPattern(plane) {
lugHolePattern = circle({
center = [-lugSpacing / 2, 0],
radius = 0.315
}, plane)
|> patternCircular2d({
arcDegrees = 360,
center = [0, 0],
instances = lugCount,
rotateDuplicates = true
}, %)
return lugHolePattern
}
rotorSketch = startSketchOn(rotorPlane)
|> circle({
center = [0, 0],
radius = rotorDiameter / 2
}, %)
|> hole(lugPattern(%), %)
rotor = extrude(rotorSinglePlateThickness, rotorSketch)
rotorBumpSketch = startSketchOn(rotorPlane)
|> circle({
center = [0, 0],
radius = rotorInnerDiameter / 2
}, %)
|> hole(lugPattern(%), %)
rotorBump = extrude(-rotorInnerDiameterThickness, rotorBumpSketch)
rotorSecondaryPlatePlane = {
plane = {
origin = {
x = 0,
y = yAxisOffset + rotorTotalThickness * 0.75,
z = 0
},
xAxis = { x = -1, y = 0, z = 0 },
yAxis = { x = 0, y = 0, z = 1 },
zAxis = { x = 0, y = 1, z = 0 }
}
}
secondaryRotorSketch = startSketchOn(rotorSecondaryPlatePlane)
|> circle({
center = [0, 0],
radius = rotorDiameter / 2
}, %)
|> hole(lugPattern(%), %)
secondRotor = extrude(rotorSinglePlateThickness, secondaryRotorSketch)
spacerSketch = startSketchOn(rotorSecondaryPlatePlane)
|> circle({
center = [spacerPatternDiameter / 2, 0],
radius = spacerDiameter
}, %)
|> patternCircular2d({
arcDegrees = 360,
center = [0, 0],
instances = spacerCount,
rotateDuplicates = true
}, %)
spacers = extrude(-spacerLength, spacerSketch)
rotorSlottedSketch = startSketchOn(rotor, 'START')
|> startProfileAt([2.17, 2.56], %)
|> xLine(0.12, %)
|> yLine(2.56, %)
|> xLine(-0.12, %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
|> patternCircular2d({
center = [0, 0],
instances = drillAndSlotCount,
arcDegrees = 360,
rotateDuplicates = true
}, %)
rotorSlotted = extrude(-rotorSinglePlateThickness / 2, rotorSlottedSketch)
rotorDrilledSketch = startSketchOn(rotor, 'START')
|> circle({ center = [1.34, 3.23], radius = 0.12 }, %)
|> patternLinear2d({
axis = [-0.02, 0.04],
instances = 3,
distance = 1.1
}, %)
|> patternCircular2d({
center = [0, 0],
instances = drillAndSlotCount,
arcDegrees = 360,
rotateDuplicates = true
}, %)
rotorDrilled = extrude(-rotorSinglePlateThickness, rotorDrilledSketch)
secondRotorSlottedSketch = startSketchOn(secondRotor, 'END')
|> startProfileAt([-2.17, 2.56], %)
|> xLine(-0.12, %)
|> yLine(2.56, %)
|> xLine(0.12, %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
|> patternCircular2d({
center = [0, 0],
instances = drillAndSlotCount,
arcDegrees = 360,
rotateDuplicates = true
}, %)
secondRotorSlotted = extrude(-rotorSinglePlateThickness / 2, secondRotorSlottedSketch)
secondRotorDrilledSketch = startSketchOn(secondRotor, 'START')
|> circle({ center = [1.34, 3.23], radius = 0.12 }, %)
|> patternLinear2d({
axis = [-0.02, 0.04],
instances = 3,
distance = 1.1
}, %)
|> patternCircular2d({
center = [0, 0],
instances = drillAndSlotCount,
arcDegrees = 360,
rotateDuplicates = true
}, %)
secondRotorDrilled = extrude(-rotorSinglePlateThickness, secondRotorDrilledSketch)