-
Notifications
You must be signed in to change notification settings - Fork 0
/
lug-nut.kcl
48 lines (41 loc) · 1.25 KB
/
lug-nut.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
// Lug Nut
// lug Nuts are essential components used to create secure connections, whether for electrical purposes, like terminating wires or grounding, or for mechanical purposes, such as providing mounting points or reinforcing structural joints.
// Define the plane the lug lives on
// Define constants
lugDiameter = 24
lugHeadLength = lugDiameter * .5
lugThreadDiameter = lugDiameter/2 * .85
lugLength = 30
lugThreadDepth = lugLength - 12.7
customPlane = {
plane: {
origin: { x: 0, y: 0, z: 0 },
xAxis: { x: 1, y: 0, z: 0 },
yAxis: { x: 0, y: 1, z: 0 },
zAxis: { x: 0, y: 0, z: 1 }
}
}
fn lug = (plane, length, diameter) => {
lugSketch = startSketchOn(customPlane)
|> startProfileAt([0 + diameter/2, 0], %)
|> angledLineOfYLength({
angle: 70,
length: lugHeadLength,
}, %)
|> xLineTo(lugDiameter/2, %)
|> yLineTo(lugLength, %)
|> tangentialArc({
offset: 90,
radius: 3,
}, %)
|> xLineTo(0+.001, %, $c1)
|> yLineTo(lugThreadDepth, %)
|> xLineTo(lugThreadDiameter, %)
|> yLineTo(0, %)
|> close(%)
|> revolve({
axis: "Y",
}, %)
return lugSketch
}
lug(customPlane, lugLength, lugDiameter)