-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.kcl
228 lines (207 loc) · 5.82 KB
/
main.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
// French Press
// A french press immersion coffee maker
carafeDiameter = 4.41
carafeHeight = 7.32
handleThickness = 0.65
// Upper ring of the metal structure
sketch001 = startSketchOn('XZ')
|> startProfileAt([carafeDiameter / 2, 5.7], %)
|> angledLine([0, 0.1], %, $rectangleSegmentA001)
|> angledLine([
segAng(rectangleSegmentA001) - 90,
-0.75
], %, $rectangleSegmentB001)
|> angledLine([
segAng(rectangleSegmentA001),
-segLen(rectangleSegmentA001)
], %, $rectangleSegmentC001)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
|> revolve({ angle = 360, axis = 'Y' }, %)
// Create an angled plane to sketch the supports
plane001 = {
plane = {
origin = [-0.26, 0.26, 0.0],
xAxis = [1, 1, 0.0],
yAxis = [0.0, 0.0, 1.0],
zAxis = [1.0, 0.0, 0.0]
}
}
// Cross section of the metal supports
sketch002 = startSketchOn(plane001)
|> startProfileAt([carafeDiameter / 2, 5.7], %)
|> xLine(0.1, %)
|> yLine(-5.2, %, $edge1)
|> arc({
angleStart = 180,
angleEnd = 205,
radius = 0.3
}, %)
|> angledLine({ angle = -60, length = 0.6 }, %, $edge2)
|> arc({
angleStart = 30,
angleEnd = -120,
radius = 0.6
}, %)
|> angledLineToY({ angle = 150, to = -0.2 }, %, $edge3)
|> arc({
angleStart = 60,
angleEnd = 90,
radius = 0.5
}, %)
|> xLineTo(0.1, %, $edgeLen)
|> yLine(0.1, %)
|> xLine(segLen(edgeLen) + 0.035, %, $edge4)
|> arc({
angleStart = 90,
angleEnd = 60,
radius = 0.6
}, %)
|> angledLine({
angle = 150,
length = -segLen(edge3) + 0.035
}, %, $edge5)
|> arc({
angleStart = -120,
angleEnd = 30,
radius = 0.5
}, %)
|> angledLine({
angle = -60,
length = -segLen(edge2) + 0.035
}, %, $edge6)
|> arc({
angleStart = 205,
angleEnd = 180,
radius = 0.6
}, %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
|> extrude(0.75, %)
|> patternCircular3d({
axis = [0, 0, 1],
center = [0, 0, 0],
instances = 4,
arcDegrees = 360,
rotateDuplicates = true
}, %)
// Cross plate
sketch003 = startSketchOn(offsetPlane('XY', 1))
|> circle({
center = [0, 0],
radius = carafeDiameter / 2 - 0.15
}, %)
extrude001 = extrude(0.050, sketch003)
sketch004 = startSketchOn(extrude001, 'END')
|> startProfileAt([0.3, 0.17], %)
|> yLine(1.2, %)
|> arc({
angleStart = 90,
angleEnd = -30,
radius = 1.2
}, %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
|> patternCircular2d({
center = [0, 0],
instances = 3,
arcDegrees = 360,
rotateDuplicates = true
}, %)
extrude002 = extrude(-0.050, sketch004)
// Filter screen
sketch005 = startSketchOn('XZ')
|> startProfileAt([0.15, 1.11], %)
|> xLineTo(carafeDiameter / 2 - 0.2, %)
|> angledLineToX({
angle = 30,
to = carafeDiameter / 2 - 0.07
}, %, $seg1)
|> angledLine({ angle = -60, length = 0.050 }, %)
|> angledLine({ angle = 30, length = -segLen(seg1) }, %)
|> xLineTo(0.15, %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
|> revolve({ axis = 'y' }, %)
// Plunger and stem
sketch006 = startSketchOn('XZ')
|> startProfileAt([0.1, 1], %)
|> line([0.1, 0], %)
|> angledLineToX({ angle = 10, to = 0.05 }, %)
|> yLine(10, %)
|> line([0.6, 0], %)
|> yLine(-.05, %)
|> tangentialArc({ radius = 0.6, offset = -90 }, %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
|> revolve({ axis = 'y' }, %)
// Spiral plate
sketch007 = startSketchOn(offsetPlane('XY', 1.12))
|> circle({
center = [0, 0],
radius = carafeDiameter / 2 - 0.24
}, %)
|> hole(circle({ center = [0, 0], radius = .15 }, %), %)
extrude003 = extrude(0.050, sketch007)
// Pattern holes in the spiral plate
sketch008 = startSketchOn(extrude003, 'END')
|> circle({ center = [1.4, 0], radius = .3 }, %)
|> patternCircular2d({
center = [0, 0],
instances = 8,
arcDegrees = 360,
rotateDuplicates = true
}, %)
extrude004 = extrude(-0.050, sketch008)
// Pattern holes in the spiral plate
sketch009 = startSketchOn(extrude003, 'END')
|> circle({ center = [0.6, 0], radius = .2 }, %)
|> patternCircular2d({
center = [0, 0],
instances = 4,
arcDegrees = 360,
rotateDuplicates = true
}, %)
extrude005 = extrude(-0.050, sketch009)
// Extrude a glass carafe body
sketch010 = startSketchOn("XY")
|> circle({
center = [0, 0],
radius = carafeDiameter / 2
}, %)
// Perform a shell operation to hollow the carafe body with the top face removed
extrude006 = extrude(carafeHeight, sketch010)
|> shell({ faces = ["end"], thickness = .07 }, %)
// Draw and revolve the lid
sketch011 = startSketchOn('XZ')
|> startProfileAt([0.2, carafeHeight - 0.7], %)
|> xLine(carafeDiameter / 2 - 0.3, %)
|> yLine(0.7, %)
|> xLine(0.3, %)
|> yLine(0.4, %)
|> line([-0.02, 0.02], %)
|> bezierCurve({
to = [-carafeDiameter / 2 - 0.1, 1],
control1 = [-0.3, 0],
control2 = [carafeDiameter / 10, 1]
}, %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
|> revolve({ axis = 'y' }, %)
// Draw and extrude handle
sketch012 = startSketchOn(offsetPlane('XZ', handleThickness / 2))
|> startProfileAt([2.3, 6.4], %)
|> line([0.56, 0], %)
|> tangentialArcTo([4.1, 5.26], %)
|> tangentialArcTo([4.17, 1.6], %)
|> tangentialArcTo([3.13, 0.61], %)
|> line([-1.09, 0], %)
|> line([0, 0.43], %)
|> line([0.99, -0.02], %)
|> tangentialArcTo([3.63, 1.6], %)
|> tangentialArcTo([3.56, 5.15], %)
|> tangentialArcTo([2.72, 5.88], %)
|> line([-0.4, 0], %)
|> lineTo([profileStartX(%), profileStartY(%)], %)
|> close(%)
extrude007 = extrude(-handleThickness, sketch012)