1- @settings(defaultLengthUnit = in)
2-
3- // Walkie talkie body
1+ // Walkie Talkie Body
2+ // The main body of the walkie talkie assembly
43
54// Set units
5+ @settings(defaultLengthUnit = in)
66
7- // Import constants
8- import height, width, thickness, chamferLength, offset, screenWidth, screenHeight, screenYPosition, screenDepth, speakerBoxWidth, speakerBoxHeight from "globals .kcl"
7+ // Import parameters
8+ import height, width, thickness, chamferLength, offset, screenWidth, screenHeight, screenYPosition, screenDepth, speakerBoxWidth, speakerBoxHeight from "parameters .kcl"
99
10- bodySketch = startSketchOn(XZ)
10+ // Sketch and extrude the body of the walkie talkie
11+ body = startSketchOn(XZ)
1112 |> startProfileAt([-width / 2, height / 2], %)
1213 |> xLine(length = width, tag = $chamfer1)
1314 |> yLine(length = -height, tag = $chamfer2)
1415 |> xLine(length = -width, tag = $chamfer3)
1516 |> close(tag = $chamfer4)
16- bodyExtrude = extrude(bodySketch , length = thickness)
17+ |> extrude(% , length = thickness)
1718 |> chamfer(
1819 length = chamferLength,
1920 tags = [
@@ -24,53 +25,48 @@ bodyExtrude = extrude(bodySketch, length = thickness)
2425 ],
2526 )
2627
27- // Define the offset for the indentation
28- sketch002 = startSketchOn(bodyExtrude, ' END' )
28+ // Cut out the indentation for the case
29+ caseIndentSketch = startSketchOn(body, face = END)
2930 |> startProfileAt([
3031 -width / 2 + offset,
3132 height / 2 - (chamferLength + offset / 2 * cos(toRadians(45)))
3233 ], %)
33- |> angledLineToY({ angle = 45, to = height / 2 - offset }, % )
34+ |> angledLine( angle = 45, endAbsoluteY = height / 2 - offset)
3435 |> line(endAbsolute = [
3536 width / 2 - (chamferLength + offset / 2 * cos(toRadians(45))),
3637 height / 2 - offset
3738 ])
38- |> angledLineToX({ angle = -45, to = width / 2 - offset }, % )
39+ |> angledLine( angle = -45, endAbsoluteX = width / 2 - offset)
3940 |> line(endAbsolute = [
4041 width / 2 - offset,
4142 -(height / 2 - (chamferLength + offset / 2 * cos(toRadians(45))))
4243 ])
43- |> angledLineToY({
44- angle = -135,
45- to = -height / 2 + offset
46- }, %)
44+ |> angledLine(angle = -135, endAbsoluteY = -height / 2 + offset)
4745 |> line(endAbsolute = [
4846 -(width / 2 - (chamferLength + offset / 2 * cos(toRadians(45)))),
4947 -height / 2 + offset
5048 ])
51- |> angledLineToX({
52- angle = -225,
53- to = -width / 2 + offset
54- }, %)
49+ |> angledLine(angle = -225, endAbsoluteX = -width / 2 + offset)
5550 |> close()
56- extrude002 = extrude(sketch002 , length = -0.0625)
51+ extrude002 = extrude(caseIndentSketch , length = -0.0625)
5752
5853// Create the pocket for the screen
59- sketch003 = startSketchOn(extrude002, 'start' )
54+ screenCutout = startSketchOn(extrude002, face = START )
6055 |> startProfileAt([-screenWidth / 2, screenYPosition], %)
6156 |> xLine(length = screenWidth, tag = $seg01)
6257 |> yLine(length = -screenHeight)
6358 |> xLine(length = -segLen(seg01))
6459 |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
6560 |> close()
66- extrude003 = extrude(sketch003 , length = screenDepth)
61+ extrude003 = extrude(screenCutout , length = screenDepth)
6762
6863// Create the speaker box
69- sketch004 = startSketchOn(extrude002, 'start' )
64+ speakerBox = startSketchOn(extrude002, face = START )
7065 |> startProfileAt([-1.25 / 2, -.125], %)
7166 |> xLine(length = speakerBoxWidth)
7267 |> yLine(length = -speakerBoxHeight)
7368 |> xLine(length = -speakerBoxWidth)
7469 |> close()
75- extrude(sketch004, length = -.5)
70+
71+ extrude(speakerBox, length = -.5)
7672 |> appearance(color = "#277bb0")
0 commit comments