Skip to content

Commit 5aa2c92

Browse files
adamchalmersjtran
andauthored
Release v100 with updated KCL (#1159)
* Release v100 with updated KCL * Update KCL examples * Fix walkie-talkie to not rely on import side-effects * Update expected mass * Update another test * Update volume test --------- Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
1 parent 24aa65d commit 5aa2c92

File tree

16 files changed

+72
-91
lines changed

16 files changed

+72
-91
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "zoo"
3-
version = "0.2.99"
3+
version = "0.2.100"
44
edition = "2021"
55
build = "build.rs"
66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

src/tests.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ access-control-allow-credentials: """#
487487
"--material-density-unit".to_string(),
488488
"lb-ft3".to_string(),
489489
],
490-
want_out: r#"68.4585"#.to_string(),
490+
want_out: r#"68.458"#.to_string(),
491491
want_err: "".to_string(),
492492
want_code: 0,
493493
..Default::default()
@@ -507,7 +507,7 @@ access-control-allow-credentials: """#
507507
"--material-density-unit".to_string(),
508508
"lb-ft3".to_string(),
509509
],
510-
want_out: r#"68.4585"#.to_string(),
510+
want_out: r#"68.458"#.to_string(),
511511
want_err: "".to_string(),
512512
want_code: 0,
513513
..Default::default()
@@ -541,7 +541,7 @@ access-control-allow-credentials: """#
541541
"--output-unit".to_string(),
542542
"cm3".to_string(),
543543
],
544-
want_out: r#"4273.72"#.to_string(),
544+
want_out: r#"4273.7"#.to_string(),
545545
want_err: "".to_string(),
546546
want_code: 0,
547547
..Default::default()

tests/gear.kcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ teeth = reduce([0..100], start, leftInvolute)
7474
|> reduce([1..101], %, rightInvolute)
7575
|> close()
7676
|> extrude(length = gearHeight)
77-
|> patternCircular3d({
77+
|> patternCircular3d(
7878
axis = [0, 0, 1],
7979
center = [0, 0, 0],
8080
instances = nTeeth,
8181
arcDegrees = 360,
8282
rotateDuplicates = true
83-
}, %)
83+
)
8484

8585
// Define the constants of the keyway and the bore hole
8686
keywayWidth = 0.250

tests/gear.png

-35 Bytes
Loading

tests/nested-settings/subdir/gear.kcl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ teeth = reduce([0..100], start, leftInvolute)
7474
|> reduce([1..101], %, rightInvolute)
7575
|> close()
7676
|> extrude(length = gearHeight)
77-
|> patternCircular3d({
77+
|> patternCircular3d(
7878
axis = [0, 0, 1],
7979
center = [0, 0, 0],
8080
instances = nTeeth,
8181
arcDegrees = 360,
8282
rotateDuplicates = true
83-
}, %)
83+
)
8484

8585
// Define the constants of the keyway and the bore hole
8686
keywayWidth = 0.250
159 Bytes
Loading

tests/walkie-talkie/antenna.kcl

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

3+
34
// Set units
45
@settings(defaultLengthUnit = in)
56

6-
// import constants
7-
import height, width, antennaBaseWidth, antennaBaseHeight, antennaTopWidth, antennaTopHeight from 'globals.kcl'
87

8+
// import constants
9+
import height, width, antennaBaseWidth, antennaBaseHeight, antennaTopWidth, antennaTopHeight from "globals.kcl"
910

1011
// Calculate the origin
1112
origin = [-width / 2 + .45, -0.10]
@@ -16,11 +17,7 @@ antennaY = origin[1]
1617

1718
antennaPlane = {
1819
plane = {
19-
origin = {
20-
x = 0,
21-
y = 0,
22-
z = height/2
23-
},
20+
origin = { x = 0, y = 0, z = height / 2 },
2421
xAxis = { x = 1, y = 0, z = 0 },
2522
yAxis = { x = 0, y = 1, z = 0 },
2623
zAxis = { x = 0, y = 0, z = 1 }
@@ -35,15 +32,19 @@ sketch001 = startSketchOn(antennaPlane)
3532
|> line(end = [-antennaBaseWidth, 0])
3633
|> close()
3734

38-
// Create the antenna top sketch
39-
loftPlane = offsetPlane('XY', height/2 + 3)
35+
// Create the antenna top sketch
36+
loftPlane = offsetPlane('XY', offset = height / 2 + 3)
4037

4138
sketch002 = startSketchOn(loftPlane)
42-
|> startProfileAt([origin[0] + (antennaBaseWidth - antennaTopWidth)/2, origin[1] - (antennaBaseHeight - antennaTopHeight)/2], %)
39+
|> startProfileAt([
40+
origin[0] + (antennaBaseWidth - antennaTopWidth) / 2,
41+
origin[1] - ((antennaBaseHeight - antennaTopHeight) / 2)
42+
], %)
4343
|> xLine(antennaTopWidth, %)
4444
|> yLine(-antennaTopHeight, %)
4545
|> xLine(-antennaTopWidth, %)
4646
|> close()
4747

4848
// Create the antenna using a loft
49-
export antenna = loft([sketch001, sketch002])
49+
loft([sketch001, sketch002])
50+
|> appearance(color = "#000000")

tests/walkie-talkie/body.kcl

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// Walkie talkie body
22

3+
34
// Set units
45
@settings(defaultLengthUnit = in)
56

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

@@ -22,11 +24,6 @@ bodyExtrude = extrude(bodySketch, length = thickness)
2224
getNextAdjacentEdge(chamfer4)
2325
]
2426
}, %)
25-
// |> appearance({
26-
// color = '#707980',
27-
// metalness = 90,
28-
// roughness = 90
29-
// }, %)
3027

3128
// Define the offset for the indentation
3229
sketch002 = startSketchOn(bodyExtrude, 'END')
@@ -58,12 +55,6 @@ sketch002 = startSketchOn(bodyExtrude, 'END')
5855
}, %)
5956
|> close()
6057
extrude002 = extrude(sketch002, length = -0.0625)
61-
// |> appearance({
62-
// color = '#707980',
63-
// metalness = 90,
64-
// roughness = 90
65-
// }, %)
66-
6758

6859
// Create the pocket for the screen
6960
sketch003 = startSketchOn(extrude002, 'start')
@@ -74,12 +65,6 @@ sketch003 = startSketchOn(extrude002, 'start')
7465
|> line(endAbsolute = [profileStartX(%), profileStartY(%)])
7566
|> close()
7667
extrude003 = extrude(sketch003, length = screenDepth)
77-
// |> appearance({
78-
// color = '#707980',
79-
// metalness = 90,
80-
// roughness = 90
81-
// }, %)
82-
8368

8469
// Create the speaker box
8570
sketch004 = startSketchOn(extrude002, 'start')
@@ -88,5 +73,8 @@ sketch004 = startSketchOn(extrude002, 'start')
8873
|> yLine(-speakerBoxHeight, %)
8974
|> xLine(-speakerBoxWidth, %)
9075
|> close()
91-
92-
export body = extrude(sketch004, length = -.5)
76+
extrude(sketch004, length = -.5)
77+
|> appearance(
78+
color = "#277bb0",
79+
)
80+

tests/walkie-talkie/button.kcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export fn button(origin, rotation, plane) {
3232
getNextAdjacentEdge(tag2)
3333
]
3434
}, %)
35+
|> appearance(color = "#ff0000")
3536

3637
return buttonExtrude
37-
}
38+
}

0 commit comments

Comments
 (0)