Skip to content

Commit

Permalink
update walkie talkie
Browse files Browse the repository at this point in the history
  • Loading branch information
r-barton committed Feb 18, 2025
1 parent 7dc9857 commit c75caf2
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 67 deletions.
29 changes: 19 additions & 10 deletions files/walkie-talkie/antenna.kcl
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
// Antenna


// Set units
@settings(defaultLengthUnit = in)


// import constants
import height, width, antennaBaseWidth, antennaBaseHeight, antennaTopWidth, antennaTopHeight from 'globals.kcl'
import height, width, antennaBaseWidth, antennaBaseHeight, antennaTopWidth, antennaTopHeight from "globals.kcl"

// Calculate the origin
origin = [-width / 2 + .45, -0.10]

// Create the antenna
Expand All @@ -11,31 +17,34 @@ antennaY = origin[1]

antennaPlane = {
plane = {
origin = {
x = 0,
y = 0,
z = height/2
},
origin = { x = 0, y = 0, z = height / 2 },
xAxis = { x = 1, y = 0, z = 0 },
yAxis = { x = 0, y = 1, z = 0 },
zAxis = { x = 0, y = 0, z = 1 }
}
}

// Create the antenna base sketch
sketch001 = startSketchOn(antennaPlane)
|> startProfileAt([origin[0], origin[1]], %)
|> line(end = [antennaBaseWidth, 0])
|> line(end = [0, -antennaBaseHeight])
|> line(end = [-antennaBaseWidth, 0])
|> close()

loftPlane = offsetPlane('XY', offset = height/2 + 3)

// Create the antenna top sketch
loftPlane = offsetPlane('XY', offset = height / 2 + 3)

sketch002 = startSketchOn(loftPlane)
|> startProfileAt([origin[0] + (antennaBaseWidth - antennaTopWidth)/2, origin[1] - (antennaBaseHeight - antennaTopHeight)/2], %)
|> startProfileAt([
origin[0] + (antennaBaseWidth - antennaTopWidth) / 2,
origin[1] - ((antennaBaseHeight - antennaTopHeight) / 2)
], %)
|> xLine(antennaTopWidth, %)
|> yLine(-antennaTopHeight, %)
|> xLine(-antennaTopWidth, %)
|> close()

export antenna = loft([sketch001, sketch002])
// Create the antenna using a loft
loft([sketch001, sketch002])
|> appearance(color = "#000000")
32 changes: 10 additions & 22 deletions files/walkie-talkie/body.kcl
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
// Walkie talkie body


// Set units
@settings(defaultLengthUnit = in)


// Import constants
import height, width, thickness, chamferLength, offset, screenWidth, screenHeight, screenYPosition, screenDepth, speakerBoxWidth, speakerBoxHeight from "globals.kcl"

// Create a function for the body
bodySketch = startSketchOn('XZ')
|> startProfileAt([-width / 2, height / 2], %)
|> xLine(width, %, $chamfer1)
Expand All @@ -20,13 +24,6 @@ bodyExtrude = extrude(bodySketch, length = thickness)
getNextAdjacentEdge(chamfer4)
]
}, %)
// |> appearance(
// color = '#707980',
// metalness = 90,
// roughness = 90
// )



// Define the offset for the indentation
sketch002 = startSketchOn(bodyExtrude, 'END')
Expand Down Expand Up @@ -58,12 +55,6 @@ sketch002 = startSketchOn(bodyExtrude, 'END')
}, %)
|> close()
extrude002 = extrude(sketch002, length = -0.0625)
// |> appearance(
// color = '#707980',
// metalness = 90,
// roughness = 90
// )


// Create the pocket for the screen
sketch003 = startSketchOn(extrude002, 'start')
Expand All @@ -74,12 +65,6 @@ sketch003 = startSketchOn(extrude002, 'start')
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
|> close()
extrude003 = extrude(sketch003, length = screenDepth)
// |> appearance(
// color = '#707980',
// metalness = 90,
// roughness = 90
// )


// Create the speaker box
sketch004 = startSketchOn(extrude002, 'start')
Expand All @@ -88,5 +73,8 @@ sketch004 = startSketchOn(extrude002, 'start')
|> yLine(-speakerBoxHeight, %)
|> xLine(-speakerBoxWidth, %)
|> close()

export body = extrude(sketch004, length = -.5)
extrude(sketch004, length = -.5)
|> appearance(
color = "#277bb0",
)

9 changes: 7 additions & 2 deletions files/walkie-talkie/button.kcl
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
// Walkie talkie button
// Walkie Talkie button

// Set units
@settings(defaultLengthUnit = in)

// Import constants
import screenHeight, buttonWidth, tolerance, buttonHeight, buttonThickness from 'globals.kcl'


// Create a function for the button
export fn button(origin, rotation, plane) {
buttonSketch = startSketchOn(plane)
Expand All @@ -28,6 +32,7 @@ export fn button(origin, rotation, plane) {
getNextAdjacentEdge(tag2)
]
}, %)
|> appearance(color = "#ff0000")

return buttonExtrude
}
}
9 changes: 8 additions & 1 deletion files/walkie-talkie/case.kcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
// Walkie talkie case


// Set units
@settings(defaultLengthUnit = in)


// Import constants and Zoo logo
import width, height, chamferLength, offset, screenWidth, screenHeight, screenYPosition, screenDepth, speakerBoxWidth, speakerBoxHeight, squareHoleSideLength, caseTolerance from "globals.kcl"
import zLogo, oLogo, oLogo2 from "zoo-logo.kcl"
Expand Down Expand Up @@ -75,4 +80,6 @@ sketch005 = startSketchOn(offsetPlane("XZ", offset = 1))
|> hole(oLogo2(plane, [-.075, -1.825], .20), %)
|> hole(oLogo(plane, [.175, -1.825], .20), %)
|> hole(oLogo2(plane, [.175, -1.825], .20), %)
export case = extrude(sketch005, length = -0.0625)

extrude(sketch005, length = -0.0625)
|> appearance(color = '#D0FF01', metalness = 0, roughness = 50)
3 changes: 3 additions & 0 deletions files/walkie-talkie/globals.kcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Global constants for the walkie talkie

// Set units
@settings(defaultLengthUnit = in)

// body
export height = 4
export width = 2.5
Expand Down
20 changes: 13 additions & 7 deletions files/walkie-talkie/knob.kcl
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
// Walkie talkie knob


// Set units
@settings(defaultLengthUnit = in)


// Import constants
import width, thickness, height, knobDiameter, knobHeight, knobRadius from "globals.kcl"


// Define the plane for the knob
knobPlane = {
plane = {
origin = {
x = width / 2 - 0.70,
x = width / 2 - 0.70,
y = -thickness / 2,
z = height / 2
},
Expand All @@ -16,9 +22,10 @@ knobPlane = {
}
}

export knob = startSketchOn(knobPlane)
// Create the knob sketch and revolve
startSketchOn(knobPlane)
|> startProfileAt([0.0001, 0], %)
|> xLine(knobDiameter/2, %)
|> xLine(knobDiameter / 2, %)
|> yLine(knobHeight - 0.05, %)
|> arc({
angleStart = 0,
Expand All @@ -27,6 +34,5 @@ export knob = startSketchOn(knobPlane)
}, %)
|> xLineTo(0.0001, %)
|> close()
|> revolve({
axis = "Y",
}, %)
|> revolve({ axis = "Y" }, %)
|> appearance(color = '#D0FF01', metalness = 90, roughness = 50)
34 changes: 12 additions & 22 deletions files/walkie-talkie/main.kcl
Original file line number Diff line number Diff line change
@@ -1,26 +1,23 @@
// Walkie Talkie
// A portable, handheld two-way radio device that allows users to communicate wirelessly over short to medium distances. It operates on specific radio frequencies and features a push-to-talk button for transmitting messages, making it ideal for quick and reliable communication in outdoor, work, or emergency settings.

// Set units
@settings(defaultLengthUnit = in)

// Import parts and constants
import body from "body.kcl"
import antenna from "antenna.kcl"
import case from "case.kcl"
import talkButton from "talk-button.kcl"
import knob from "knob.kcl"
import width, height, thickness, screenWidth, screenHeight, screenYPosition, tolerance from "globals.kcl"
import 'body.kcl'
import 'antenna.kcl'
import 'case.kcl'
import 'talk-button.kcl' as talkButton
import 'knob.kcl'
import button from "button.kcl"
import width, height, thickness, screenWidth, screenHeight, screenYPosition, tolerance from "globals.kcl"

// Import the body
body

// Import the case
case
|> appearance(
color = '#D0FF01',
metalness = 0,
roughness = 50
)

// Import the antenna
antenna
Expand All @@ -45,16 +42,9 @@ button([

// Import the talk button
talkButton
|> appearance(
color = '#D0FF01',
metalness = 90,
roughness = 90
)


// Import the frequency knob
knob
|> appearance(
color = '#D0FF01',
metalness = 90,
roughness = 50
)



14 changes: 11 additions & 3 deletions files/walkie-talkie/talk-button.kcl
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
// Walkie talkie talk button


// Set units
@settings(defaultLengthUnit = in)


// Import constants
import width, thickness, talkButtonSideLength, talkButtonHeight from "globals.kcl"

talkButtonPlane = {
plane = {
origin = {
x = width/2,
y = -thickness/2,
x = width / 2,
y = -thickness / 2,
z = .5
},
xAxis = { x = 0, y = 1, z = 0 },
Expand All @@ -16,6 +21,7 @@ talkButtonPlane = {
}
}

// Create the talk button sketch
talkButtonSketch = startSketchOn(talkButtonPlane)
|> startProfileAt([
-talkButtonSideLength / 2,
Expand All @@ -26,7 +32,8 @@ talkButtonSketch = startSketchOn(talkButtonPlane)
|> xLine(-talkButtonSideLength, %, $tag3)
|> close(tag = $tag4)

export talkButton = extrude(talkButtonSketch, length = talkButtonHeight)
// Create the talk button and apply fillets
extrude(talkButtonSketch, length = talkButtonHeight)
|> fillet({
radius = 0.050,
tags = [
Expand All @@ -36,3 +43,4 @@ export talkButton = extrude(talkButtonSketch, length = talkButtonHeight)
getNextAdjacentEdge(tag4)
]
}, %)
|> appearance(color = '#D0FF01', metalness = 90, roughness = 90)

0 comments on commit c75caf2

Please sign in to comment.