Previous: ``` startProfileAt([x, y], %) startProfileAt([x, y], sketch001) ``` New: ``` startProfile(%, at = [x, y]) startProfile(sketch001, at = [x, y]) ```
33 lines
993 B
Plaintext
33 lines
993 B
Plaintext
// Walkie Talkie Antenna
|
|
// Antenna for the walkie talkie assembly
|
|
|
|
// Set units
|
|
@settings(defaultLengthUnit = in)
|
|
|
|
// Import parameters
|
|
import antennaLength, antennaBaseWidth, antennaBaseHeight, antennaTopWidth, antennaTopHeight from "parameters.kcl"
|
|
|
|
// Create the antenna base sketch
|
|
antennaBaseSketch = startSketchOn(XY)
|
|
|> startProfile(at = [0, 0])
|
|
|> line(end = [antennaBaseWidth, 0])
|
|
|> line(end = [0, -antennaBaseHeight])
|
|
|> line(end = [-antennaBaseWidth, 0])
|
|
|> close()
|
|
|
|
// Create the antenna top sketch
|
|
loftPlane = offsetPlane(XY, offset = antennaLength)
|
|
antennaTopSketch = startSketchOn(loftPlane)
|
|
|> startProfile(at = [
|
|
(antennaBaseWidth - antennaTopWidth) / 2,
|
|
(antennaBaseHeight - antennaTopHeight) / 2
|
|
])
|
|
|> xLine(length = antennaTopWidth)
|
|
|> yLine(length = -antennaTopHeight)
|
|
|> xLine(length = -antennaTopWidth)
|
|
|> close()
|
|
|
|
// Create the antenna using a loft
|
|
loft([antennaBaseSketch, antennaTopSketch])
|
|
|> appearance(color = "#000000")
|