Skip to content

Commit 8ab0bee

Browse files
committed
updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
1 parent 615b7ef commit 8ab0bee

File tree

10 files changed

+256
-283
lines changed

10 files changed

+256
-283
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "zoo"
3-
version = "0.2.95"
3+
version = "0.2.96"
44
edition = "2021"
55
build = "build.rs"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -22,7 +22,7 @@ git_rev = "0.1.0"
2222
heck = "0.5.0"
2323
http = "1"
2424
itertools = "0.12.1"
25-
kcl-lib = { version = "0.2.31", features = ["disable-println"] }
25+
kcl-lib = { version = "0.2.32", features = ["disable-println"] }
2626
kcl-test-server = "0.1.20"
2727
kittycad = { version = "0.3.28", features = ["clap", "tabled", "requests", "retry"] }
2828
kittycad-modeling-cmds = { version = "0.2.94", features = ["websocket", "convert_client_crate", "tabled"] }

tests/walkie-talkie/antenna.kcl

Lines changed: 31 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,41 @@
11
// Antenna
22

3-
43
// import constants
54
import height, width, antennaBaseWidth, antennaBaseHeight, antennaTopWidth, antennaTopHeight from 'globals.kcl'
65

7-
// Create the function for the antenna
8-
export fn antenna (origin) {
9-
antennaX = origin[0]
10-
antennaY = origin[1]
6+
origin = [-width / 2 + .45, -0.10]
7+
8+
// Create the antenna
9+
antennaX = origin[0]
10+
antennaY = origin[1]
1111

12-
antennaPlane = {
13-
plane = {
14-
origin = {
15-
x = 0,
16-
y = 0,
17-
z = height/2
18-
},
19-
xAxis = { x = 1, y = 0, z = 0 },
20-
yAxis = { x = 0, y = 1, z = 0 },
21-
zAxis = { x = 0, y = 0, z = 1 }
22-
}
12+
antennaPlane = {
13+
plane = {
14+
origin = {
15+
x = 0,
16+
y = 0,
17+
z = height/2
18+
},
19+
xAxis = { x = 1, y = 0, z = 0 },
20+
yAxis = { x = 0, y = 1, z = 0 },
21+
zAxis = { x = 0, y = 0, z = 1 }
2322
}
24-
25-
sketch001 = startSketchOn(antennaPlane)
26-
|> startProfileAt([origin[0], origin[1]], %)
27-
|> line([antennaBaseWidth, 0], %)
28-
|> line([0, -antennaBaseHeight], %)
29-
|> line([-antennaBaseWidth, 0], %)
30-
|> close(%)
31-
32-
loftPlane = offsetPlane('XY', height/2 + 3)
33-
34-
sketch002 = startSketchOn(loftPlane)
35-
|> startProfileAt([origin[0] + (antennaBaseWidth - antennaTopWidth)/2, origin[1] - (antennaBaseHeight - antennaTopHeight)/2], %)
36-
|> xLine(antennaTopWidth, %)
37-
|> yLine(-antennaTopHeight, %)
38-
|> xLine(-antennaTopWidth, %)
39-
|> close(%)
23+
}
4024

41-
antennaLoft = loft([sketch001, sketch002])
25+
sketch001 = startSketchOn(antennaPlane)
26+
|> startProfileAt([origin[0], origin[1]], %)
27+
|> line([antennaBaseWidth, 0], %)
28+
|> line([0, -antennaBaseHeight], %)
29+
|> line([-antennaBaseWidth, 0], %)
30+
|> close(%)
4231

43-
return antennaLoft
32+
loftPlane = offsetPlane('XY', height/2 + 3)
33+
34+
sketch002 = startSketchOn(loftPlane)
35+
|> startProfileAt([origin[0] + (antennaBaseWidth - antennaTopWidth)/2, origin[1] - (antennaBaseHeight - antennaTopHeight)/2], %)
36+
|> xLine(antennaTopWidth, %)
37+
|> yLine(-antennaTopHeight, %)
38+
|> xLine(-antennaTopWidth, %)
39+
|> close(%)
4440

45-
}
41+
export antenna = loft([sketch001, sketch002])

tests/walkie-talkie/body.kcl

Lines changed: 81 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -4,93 +4,89 @@
44
import height, width, thickness, chamferLength, offset, screenWidth, screenHeight, screenYPosition, screenDepth, speakerBoxWidth, speakerBoxHeight from "globals.kcl"
55

66
// Create a function for the body
7-
export fn body() {
8-
bodySketch = startSketchOn('XZ')
9-
|> startProfileAt([-width / 2, height / 2], %)
10-
|> xLine(width, %, $chamfer1)
11-
|> yLine(-height, %, $chamfer2)
12-
|> xLine(-width, %, $chamfer3)
13-
|> close(%, $chamfer4)
14-
bodyExtrude = extrude(thickness, bodySketch)
15-
|> chamfer({
16-
length = chamferLength,
17-
tags = [
18-
getNextAdjacentEdge(chamfer1),
19-
getNextAdjacentEdge(chamfer2),
20-
getNextAdjacentEdge(chamfer3),
21-
getNextAdjacentEdge(chamfer4)
22-
]
23-
}, %)
24-
// |> appearance({
25-
// color = '#707980',
26-
// metalness = 90,
27-
// roughness = 90
28-
// }, %)
29-
30-
7+
bodySketch = startSketchOn('XZ')
8+
|> startProfileAt([-width / 2, height / 2], %)
9+
|> xLine(width, %, $chamfer1)
10+
|> yLine(-height, %, $chamfer2)
11+
|> xLine(-width, %, $chamfer3)
12+
|> close(%, $chamfer4)
13+
bodyExtrude = extrude(thickness, bodySketch)
14+
|> chamfer({
15+
length = chamferLength,
16+
tags = [
17+
getNextAdjacentEdge(chamfer1),
18+
getNextAdjacentEdge(chamfer2),
19+
getNextAdjacentEdge(chamfer3),
20+
getNextAdjacentEdge(chamfer4)
21+
]
22+
}, %)
23+
// |> appearance({
24+
// color = '#707980',
25+
// metalness = 90,
26+
// roughness = 90
27+
// }, %)
3128

32-
// Define the offset for the indentation
33-
sketch002 = startSketchOn(bodyExtrude, 'END')
34-
|> startProfileAt([
35-
-width / 2 + offset,
36-
height / 2 - (chamferLength + offset / 2 * cos(toRadians(45)))
37-
], %)
38-
|> angledLineToY({ angle = 45, to = height / 2 - offset }, %)
39-
|> lineTo([
40-
width / 2 - (chamferLength + offset / 2 * cos(toRadians(45))),
41-
height / 2 - offset
42-
], %)
43-
|> angledLineToX({ angle = -45, to = width / 2 - offset }, %)
44-
|> lineTo([
45-
width / 2 - offset,
46-
-(height / 2 - (chamferLength + offset / 2 * cos(toRadians(45))))
47-
], %)
48-
|> angledLineToY({
49-
angle = -135,
50-
to = -height / 2 + offset
51-
}, %)
52-
|> lineTo([
53-
-(width / 2 - (chamferLength + offset / 2 * cos(toRadians(45)))),
54-
-height / 2 + offset
55-
], %)
56-
|> angledLineToX({
57-
angle = -225,
58-
to = -width / 2 + offset
59-
}, %)
60-
|> close(%)
61-
extrude002 = extrude(-0.0625, sketch002)
62-
// |> appearance({
63-
// color = '#707980',
64-
// metalness = 90,
65-
// roughness = 90
66-
// }, %)
6729

6830

69-
// Create the pocket for the screen
70-
sketch003 = startSketchOn(extrude002, 'start')
71-
|> startProfileAt([-screenWidth / 2, screenYPosition], %)
72-
|> xLine(screenWidth, %, $seg01)
73-
|> yLine(-screenHeight, %)
74-
|> xLine(-segLen(seg01), %)
75-
|> lineTo([profileStartX(%), profileStartY(%)], %)
76-
|> close(%)
77-
extrude003 = extrude(screenDepth, sketch003)
78-
// |> appearance({
79-
// color = '#707980',
80-
// metalness = 90,
81-
// roughness = 90
82-
// }, %)
83-
31+
// Define the offset for the indentation
32+
sketch002 = startSketchOn(bodyExtrude, 'END')
33+
|> startProfileAt([
34+
-width / 2 + offset,
35+
height / 2 - (chamferLength + offset / 2 * cos(toRadians(45)))
36+
], %)
37+
|> angledLineToY({ angle = 45, to = height / 2 - offset }, %)
38+
|> lineTo([
39+
width / 2 - (chamferLength + offset / 2 * cos(toRadians(45))),
40+
height / 2 - offset
41+
], %)
42+
|> angledLineToX({ angle = -45, to = width / 2 - offset }, %)
43+
|> lineTo([
44+
width / 2 - offset,
45+
-(height / 2 - (chamferLength + offset / 2 * cos(toRadians(45))))
46+
], %)
47+
|> angledLineToY({
48+
angle = -135,
49+
to = -height / 2 + offset
50+
}, %)
51+
|> lineTo([
52+
-(width / 2 - (chamferLength + offset / 2 * cos(toRadians(45)))),
53+
-height / 2 + offset
54+
], %)
55+
|> angledLineToX({
56+
angle = -225,
57+
to = -width / 2 + offset
58+
}, %)
59+
|> close(%)
60+
extrude002 = extrude(-0.0625, sketch002)
61+
// |> appearance({
62+
// color = '#707980',
63+
// metalness = 90,
64+
// roughness = 90
65+
// }, %)
66+
67+
68+
// Create the pocket for the screen
69+
sketch003 = startSketchOn(extrude002, 'start')
70+
|> startProfileAt([-screenWidth / 2, screenYPosition], %)
71+
|> xLine(screenWidth, %, $seg01)
72+
|> yLine(-screenHeight, %)
73+
|> xLine(-segLen(seg01), %)
74+
|> lineTo([profileStartX(%), profileStartY(%)], %)
75+
|> close(%)
76+
extrude003 = extrude(screenDepth, sketch003)
77+
// |> appearance({
78+
// color = '#707980',
79+
// metalness = 90,
80+
// roughness = 90
81+
// }, %)
82+
8483

85-
// Create the speaker box
86-
sketch004 = startSketchOn(extrude002, 'start')
87-
|> startProfileAt([-1.25 / 2, -.125], %)
88-
|> xLine(speakerBoxWidth, %)
89-
|> yLine(-speakerBoxHeight, %)
90-
|> xLine(-speakerBoxWidth, %)
91-
|> close(%)
92-
93-
extrude004 = extrude(-.5, sketch004)
84+
// Create the speaker box
85+
sketch004 = startSketchOn(extrude002, 'start')
86+
|> startProfileAt([-1.25 / 2, -.125], %)
87+
|> xLine(speakerBoxWidth, %)
88+
|> yLine(-speakerBoxHeight, %)
89+
|> xLine(-speakerBoxWidth, %)
90+
|> close(%)
9491

95-
return extrude004
96-
}
92+
export body = extrude(-.5, sketch004)

tests/walkie-talkie/button.kcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ export fn button(origin, rotation, plane) {
3030
}, %)
3131

3232
return buttonExtrude
33-
}
33+
}

0 commit comments

Comments
 (0)