-
Notifications
You must be signed in to change notification settings - Fork 0
/
food-service-spatula.kcl
161 lines (140 loc) · 4.64 KB
/
food-service-spatula.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
161
// Food Service Spatula
// Use these spatulas for mixing, flipping, and scraping.
// Define constants in millimeters (mm)
flipperThickness = 3.5
flipperLength = 70.0
handleWidth = 15.0
gripLength = 150.0
flipperFilletRadius = 5.0
flipperSlotWidth = 10.0
gripWidth = 10.0
gripHeight = 20.0
gripFilletRadius = 3.0
gripSlotWidth = 8.0
// function for drawing slots on a sketch given the start and end points as well as a width
fn slot = (sketch1, start, end, width) => {
angle = if start[0] == end[0] {
if end[1] > start[1] {
90
} else {
270
}
} else {
if end[0] < start[0] {
toDegrees(atan((end[1] - start[1]) / (end[0] - start[0]))) + 180
} else {
toDegrees(atan((end[1] - start[1]) / (end[0] - start[0])))
}
}
dist = sqrt(pow(end[1] - start[1], 2) + pow(end[0] - start[0], 2))
xstart = width / 2 * cos(toRadians(angle - 90)) + start[0]
ystart = width / 2 * sin(toRadians(angle - 90)) + start[1]
slotSketch = startProfileAt([xstart, ystart], sketch1)
|> angledLine({ angle: angle, length: dist }, %, $line000)
|> tangentialArc({ radius: width / 2, offset: 180 }, %, $arc000)
|> angledLine({ angle: angle, length: -dist }, %, $line001)
|> tangentialArcTo([profileStartX(%), profileStartY(%)], %, $arc001)
|> close(%)
return slotSketch
}
// create a sketch on the "XY" plane
sketch000 = startSketchOn('XY')
// create a profile of the flipper
flipperProfile = startProfileAt([-flipperLength, -32.000000], sketch000)
|> line([flipperLength, 2.000000], %)
|> yLine(60.000000, %, $backEdge)
|> line([-flipperLength, 2.000000], %)
|> arc({
angleEnd: 196.912390,
angleStart: 163.087610,
radius: 110.000000
}, %)
|> close(%)
// create a profile of the middle
slotProfile000 = slot(sketch000, [-25, 0], [-55, 0], flipperSlotWidth)
// create a profile of the top slot
slotProfile001 = slot(sketch000, [-25, 18], [-55, 19], flipperSlotWidth)
// create a profile of the bottom slot
slotProfile002 = slot(sketch000, [-25, -18], [-55, -19], flipperSlotWidth)
// create a profile with slots for the spatula
spatulaProfile = flipperProfile
|> hole(slotProfile000, %)
|> hole(slotProfile001, %)
|> hole(slotProfile002, %)
// extrude the profile to create the spatula flipper
flipper = extrude(flipperThickness, [spatulaProfile])
// fillet the edges of the flipper
fillet({
radius: flipperFilletRadius,
tags: [
getNextAdjacentEdge(backEdge),
getPreviousAdjacentEdge(backEdge)
]
}, flipper)
// create a sketch on the "XZ" plane offset by half the thickness
sketch001 = startSketchOn(offsetPlane("XZ", -handleWidth / 2))
// create a profile of the spatula handle
handleProfile = startProfileAt([0.000000, flipperThickness], sketch001)
|> line([31.819805, 31.819805], %, $handleBottomEdge)
|> line([140.953893, 51.303021], %)
|> line([-1.710101, 4.698463], %)
|> line([-141.995517, -51.682142], %, $handleTopEdge)
|> line([-36.139148, -36.139148], %)
|> xLine(7.071068, %)
|> close(%)
// create an extrusion extrude001
handle = extrude(handleWidth, [handleProfile])
// fillet the bend of the spatula handle
fillet({
radius: 4,
tags: [
getNextAdjacentEdge(handleBottomEdge),
getNextAdjacentEdge(handleTopEdge)
]
}, handle)
// define a plane which is at the end of the handle
handlePlane = {
plane: {
origin: [208.593833, 0.000000, 75.921946],
xAxis: [0.342020, -0.000000, -0.939693],
yAxis: [0.000000, 1.000000, 0.000000],
zAxis: [0.939693, -0.000000, 0.342020]
}
}
// create a sketch on the handle plane
sketch002 = startSketchOn(handlePlane)
// create a profile of the grip
gripProfile = startProfileAt([-26.806746, -10.000000], sketch002)
|> xLine(gripWidth - 2 * gripFilletRadius, %)
|> arc({
angleStart: -90.000000,
angleEnd: 0.000000,
radius: gripFilletRadius
}, %)
|> yLine(gripHeight - 2 * gripFilletRadius, %)
|> arc({
angleStart: 0.000000,
angleEnd: 90.000000,
radius: gripFilletRadius
}, %)
|> xLine(-(gripWidth - 2 * gripFilletRadius), %)
|> arc({
angleStart: 90.000000,
angleEnd: 180.000000,
radius: gripFilletRadius
}, %)
|> yLine(-(gripHeight - 2 * gripFilletRadius), %, $gripEdgeTop)
|> arc({
angleStart: 180.000000,
angleEnd: 270.000000,
radius: gripFilletRadius
}, %)
|> close(%)
// extrude the grip profile to create the grip
grip = extrude(-gripLength, [gripProfile])
// create a sketch on the grip for the hole
sketch003 = startSketchOn(grip, gripEdgeTop)
// create a profile for the grip hole
gripHoleProfile = slot(sketch003, [0, 200], [0, 210], gripSlotWidth)
// cut a hole in the grip
extrude(-gripWidth, gripHoleProfile)