2025-04-04 11:03:13 -07:00
|
|
|
// Walkie Talkie Body
|
|
|
|
// The main body of the walkie talkie assembly
|
2025-03-06 18:01:24 -05:00
|
|
|
|
2025-04-04 11:03:13 -07:00
|
|
|
// Set units
|
2025-05-06 08:44:03 +12:00
|
|
|
@settings(defaultLengthUnit = in, kclVersion = 1.0)
|
2025-03-06 18:01:24 -05:00
|
|
|
|
2025-04-04 11:03:13 -07:00
|
|
|
// Import parameters
|
|
|
|
import height, width, thickness, chamferLength, offset, screenWidth, screenHeight, screenYPosition, screenDepth, speakerBoxWidth, speakerBoxHeight from "parameters.kcl"
|
2025-03-06 18:01:24 -05:00
|
|
|
|
2025-04-04 11:03:13 -07:00
|
|
|
// Sketch and extrude the body of the walkie talkie
|
|
|
|
body = startSketchOn(XZ)
|
2025-04-25 16:01:35 -05:00
|
|
|
|> startProfile(at = [-width / 2, height / 2])
|
2025-04-04 11:03:13 -07:00
|
|
|
|> xLine(length = width, tag = $chamfer1)
|
|
|
|
|> yLine(length = -height, tag = $chamfer2)
|
|
|
|
|> xLine(length = -width, tag = $chamfer3)
|
|
|
|
|> close(tag = $chamfer4)
|
|
|
|
|> extrude(%, length = thickness)
|
|
|
|
|> chamfer(
|
|
|
|
length = chamferLength,
|
|
|
|
tags = [
|
|
|
|
getNextAdjacentEdge(chamfer1),
|
|
|
|
getNextAdjacentEdge(chamfer2),
|
|
|
|
getNextAdjacentEdge(chamfer3),
|
|
|
|
getNextAdjacentEdge(chamfer4)
|
|
|
|
],
|
|
|
|
)
|
2025-03-06 18:01:24 -05:00
|
|
|
|
2025-04-04 11:03:13 -07:00
|
|
|
// Cut out the indentation for the case
|
2025-04-14 05:58:19 -04:00
|
|
|
caseIndentSketch = startSketchOn(body, face = END)
|
2025-04-25 16:01:35 -05:00
|
|
|
|> startProfile(at = [
|
2025-04-04 11:03:13 -07:00
|
|
|
-width / 2 + offset,
|
2025-04-30 11:07:05 -04:00
|
|
|
height / 2 - (chamferLength + offset / 2 * cos(45deg))
|
2025-04-25 16:01:35 -05:00
|
|
|
])
|
KCL: Angled line should use keyword args (#5803)
We continue migrating KCL stdlib functions to use keyword arguments. Next up is the `angledLine` family of functions (except `angledLineThatIntersects, which will be a quick follow-up).
Before vs. after:
`angledLine({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, length = 3, tag = $edge)`
`angledLineOfXLength({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, lengthX = 3, tag = $edge)`
`angledLineOfYLength({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, lengthY = 3, tag = $edge)`
`angledLineToX({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, endAbsoluteX = 3, tag = $edge)`
`angledLineToY({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, endAbsoluteY = 3, tag = $edge)`
2025-04-09 14:55:15 -05:00
|
|
|
|> angledLine(angle = 45, endAbsoluteY = height / 2 - offset)
|
2025-04-04 11:03:13 -07:00
|
|
|
|> line(endAbsolute = [
|
2025-04-30 11:07:05 -04:00
|
|
|
width / 2 - (chamferLength + offset / 2 * cos(45deg)),
|
2025-04-04 11:03:13 -07:00
|
|
|
height / 2 - offset
|
|
|
|
])
|
KCL: Angled line should use keyword args (#5803)
We continue migrating KCL stdlib functions to use keyword arguments. Next up is the `angledLine` family of functions (except `angledLineThatIntersects, which will be a quick follow-up).
Before vs. after:
`angledLine({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, length = 3, tag = $edge)`
`angledLineOfXLength({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, lengthX = 3, tag = $edge)`
`angledLineOfYLength({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, lengthY = 3, tag = $edge)`
`angledLineToX({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, endAbsoluteX = 3, tag = $edge)`
`angledLineToY({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, endAbsoluteY = 3, tag = $edge)`
2025-04-09 14:55:15 -05:00
|
|
|
|> angledLine(angle = -45, endAbsoluteX = width / 2 - offset)
|
2025-04-04 11:03:13 -07:00
|
|
|
|> line(endAbsolute = [
|
|
|
|
width / 2 - offset,
|
2025-04-30 11:07:05 -04:00
|
|
|
-(height / 2 - (chamferLength + offset / 2 * cos(45deg)))
|
2025-04-04 11:03:13 -07:00
|
|
|
])
|
KCL: Angled line should use keyword args (#5803)
We continue migrating KCL stdlib functions to use keyword arguments. Next up is the `angledLine` family of functions (except `angledLineThatIntersects, which will be a quick follow-up).
Before vs. after:
`angledLine({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, length = 3, tag = $edge)`
`angledLineOfXLength({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, lengthX = 3, tag = $edge)`
`angledLineOfYLength({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, lengthY = 3, tag = $edge)`
`angledLineToX({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, endAbsoluteX = 3, tag = $edge)`
`angledLineToY({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, endAbsoluteY = 3, tag = $edge)`
2025-04-09 14:55:15 -05:00
|
|
|
|> angledLine(angle = -135, endAbsoluteY = -height / 2 + offset)
|
2025-04-04 11:03:13 -07:00
|
|
|
|> line(endAbsolute = [
|
2025-04-30 11:07:05 -04:00
|
|
|
-(width / 2 - (chamferLength + offset / 2 * cos(45deg))),
|
2025-04-04 11:03:13 -07:00
|
|
|
-height / 2 + offset
|
|
|
|
])
|
KCL: Angled line should use keyword args (#5803)
We continue migrating KCL stdlib functions to use keyword arguments. Next up is the `angledLine` family of functions (except `angledLineThatIntersects, which will be a quick follow-up).
Before vs. after:
`angledLine({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, length = 3, tag = $edge)`
`angledLineOfXLength({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, lengthX = 3, tag = $edge)`
`angledLineOfYLength({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, lengthY = 3, tag = $edge)`
`angledLineToX({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, endAbsoluteX = 3, tag = $edge)`
`angledLineToY({angle = 90, length = 3}, %, $edge)`
=> `angledLine(angle = 90, endAbsoluteY = 3, tag = $edge)`
2025-04-09 14:55:15 -05:00
|
|
|
|> angledLine(angle = -225, endAbsoluteX = -width / 2 + offset)
|
2025-04-04 11:03:13 -07:00
|
|
|
|> close()
|
|
|
|
extrude002 = extrude(caseIndentSketch, length = -0.0625)
|
2025-03-26 08:53:34 -07:00
|
|
|
|
2025-04-04 11:03:13 -07:00
|
|
|
// Create the pocket for the screen
|
2025-04-14 05:58:19 -04:00
|
|
|
screenCutout = startSketchOn(extrude002, face = START)
|
2025-04-25 16:01:35 -05:00
|
|
|
|> startProfile(at = [-screenWidth / 2, screenYPosition])
|
2025-04-04 11:03:13 -07:00
|
|
|
|> xLine(length = screenWidth, tag = $seg01)
|
|
|
|
|> yLine(length = -screenHeight)
|
|
|
|
|> xLine(length = -segLen(seg01))
|
|
|
|
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|
|
|
|
|> close()
|
|
|
|
extrude003 = extrude(screenCutout, length = screenDepth)
|
2025-03-26 08:53:34 -07:00
|
|
|
|
2025-04-04 11:03:13 -07:00
|
|
|
// Create the speaker box
|
2025-04-14 05:58:19 -04:00
|
|
|
speakerBox = startSketchOn(extrude002, face = START)
|
2025-04-25 16:01:35 -05:00
|
|
|
|> startProfile(at = [-1.25 / 2, -.125])
|
2025-04-04 11:03:13 -07:00
|
|
|
|> xLine(length = speakerBoxWidth)
|
|
|
|
|> yLine(length = -speakerBoxHeight)
|
|
|
|
|> xLine(length = -speakerBoxWidth)
|
|
|
|
|> close()
|
2025-03-06 18:01:24 -05:00
|
|
|
|
2025-04-04 11:03:13 -07:00
|
|
|
extrude(speakerBox, length = -.5)
|
|
|
|
|> appearance(color = "#277bb0")
|