John Smith
john@example.com
// Walkie Talkie button
// set units
@settings(defaultLengthUnit = in)
// import constants
import buttonWidth, buttonHeight, buttonThickness from 'globals.kcl'
// create a function to define the button
export fn button() {
// sketch the button profile and extrude
buttonSketch = startSketchOn('XZ')
|> startProfileAt([0, 0], %)
|> angledLine({
angle = 180,
length = buttonWidth
}, %, $tag1)
angle = 270,
length = buttonHeight
}, %, $tag2)
angle = 0,
}, %)
|> close()
buttonExtrude = extrude(buttonSketch, length = buttonThickness)
|> chamfer(
length = .050,
tags = [
getNextAdjacentEdge(tag1),
getNextAdjacentEdge(tag2)
]
)
|> appearance(color = "#ff0000")
return buttonExtrude
}