Skip to content

Commit d622e9d

Browse files
authored
remove units (#1140)
* remove units Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
1 parent d1e0347 commit d622e9d

File tree

11 files changed

+109
-164
lines changed

11 files changed

+109
-164
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ releases
1818
.DS_Store
1919

2020
# test files
21-
gear.png
21+
/gear.png
2222
in_obj.png
2323
output.png
2424
/source.*

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.96"
3+
version = "0.2.97"
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.32", features = ["disable-println"] }
25+
kcl-lib = { version = "0.2.33", 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"] }

src/cmd_kcl.rs

Lines changed: 66 additions & 145 deletions
Large diffs are not rendered by default.

src/tests.rs

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,34 @@ access-control-allow-credentials: """#
410410
want_code: 0,
411411
..Default::default()
412412
},
413+
TestItem {
414+
name: "snapshot a kcl file with a project.toml as png".to_string(),
415+
args: vec![
416+
"zoo".to_string(),
417+
"kcl".to_string(),
418+
"snapshot".to_string(),
419+
"tests/with-settings/gear.kcl".to_string(),
420+
"tests/with-settings/gear.png".to_string(),
421+
],
422+
want_out: r#"Snapshot saved to `tests/with-settings/gear.png`"#.to_string(),
423+
want_err: "".to_string(),
424+
want_code: 0,
425+
..Default::default()
426+
},
427+
TestItem {
428+
name: "snapshot a kcl file with a nested project.toml as png".to_string(),
429+
args: vec![
430+
"zoo".to_string(),
431+
"kcl".to_string(),
432+
"snapshot".to_string(),
433+
"tests/nested-settings/subdir/gear.kcl".to_string(),
434+
"tests/nested-settings/subdir/gear.png".to_string(),
435+
],
436+
want_out: r#"Snapshot saved to `tests/nested-settings/subdir/gear.png`"#.to_string(),
437+
want_err: "".to_string(),
438+
want_code: 0,
439+
..Default::default()
440+
},
413441
TestItem {
414442
name: "snapshot a kcl assembly as png".to_string(),
415443
args: vec![
@@ -431,7 +459,6 @@ access-control-allow-credentials: """#
431459
"kcl".to_string(),
432460
"mass".to_string(),
433461
"tests/gear.kcl".to_string(),
434-
"--src-unit=ft".to_string(),
435462
"--format=json".to_string(),
436463
"--output-unit".to_string(),
437464
"g".to_string(),
@@ -440,7 +467,7 @@ access-control-allow-credentials: """#
440467
"--material-density-unit".to_string(),
441468
"lb-ft3".to_string(),
442469
],
443-
want_out: r#"118296.40"#.to_string(),
470+
want_out: r#"0.004174"#.to_string(),
444471
want_err: "".to_string(),
445472
want_code: 0,
446473
..Default::default()
@@ -460,7 +487,7 @@ access-control-allow-credentials: """#
460487
"--material-density-unit".to_string(),
461488
"lb-ft3".to_string(),
462489
],
463-
want_out: r#"24.905729521549706"#.to_string(),
490+
want_out: r#"0.0015198"#.to_string(),
464491
want_err: "".to_string(),
465492
want_code: 0,
466493
..Default::default()
@@ -480,7 +507,7 @@ access-control-allow-credentials: """#
480507
"--material-density-unit".to_string(),
481508
"lb-ft3".to_string(),
482509
],
483-
want_out: r#"24.905729521549706"#.to_string(),
510+
want_out: r#"0.0015198"#.to_string(),
484511
want_err: "".to_string(),
485512
want_code: 0,
486513
..Default::default()
@@ -492,7 +519,6 @@ access-control-allow-credentials: """#
492519
"kcl".to_string(),
493520
"density".to_string(),
494521
"tests/gear.kcl".to_string(),
495-
"--src-unit=mm".to_string(),
496522
"--output-unit".to_string(),
497523
"lb-ft3".to_string(),
498524
"--material-mass-unit".to_string(),
@@ -512,7 +538,6 @@ access-control-allow-credentials: """#
512538
"kcl".to_string(),
513539
"volume".to_string(),
514540
"tests/gear.kcl".to_string(),
515-
"--src-unit=mm".to_string(),
516541
"--output-unit".to_string(),
517542
"cm3".to_string(),
518543
],
@@ -528,7 +553,6 @@ access-control-allow-credentials: """#
528553
"kcl".to_string(),
529554
"surface-area".to_string(),
530555
"tests/gear.kcl".to_string(),
531-
"--src-unit=mm".to_string(),
532556
"--output-unit".to_string(),
533557
"cm2".to_string(),
534558
],
@@ -544,7 +568,6 @@ access-control-allow-credentials: """#
544568
"kcl".to_string(),
545569
"center-of-mass".to_string(),
546570
"tests/gear.kcl".to_string(),
547-
"--src-unit=mm".to_string(),
548571
"--output-unit".to_string(),
549572
"cm".to_string(),
550573
],
@@ -560,7 +583,6 @@ access-control-allow-credentials: """#
560583
"kcl".to_string(),
561584
"export".to_string(),
562585
"--output-format=gltf".to_string(),
563-
"--src-unit=mm".to_string(),
564586
"tests/gear.kcl".to_string(),
565587
"tests/".to_string(),
566588
],
@@ -577,7 +599,6 @@ access-control-allow-credentials: """#
577599
"export".to_string(),
578600
"--output-format=step".to_string(),
579601
"--deterministic".to_string(),
580-
"--src-unit=mm".to_string(),
581602
"tests/gear.kcl".to_string(),
582603
"tests/".to_string(),
583604
],
@@ -593,7 +614,6 @@ access-control-allow-credentials: """#
593614
"kcl".to_string(),
594615
"export".to_string(),
595616
"--output-format=gltf".to_string(),
596-
"--src-unit=mm".to_string(),
597617
"tests/parse_error.kcl".to_string(),
598618
"tests/".to_string(),
599619
],

tests/gear.png

81.7 KB
Loading

tests/nested-settings/project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
[settings.app]
22

33
[settings.modeling]
4-
base_unit = "in"
4+
show_scale_grid = true
5+
highlight_edges = false
6+
enable_ssao = false
57

68
[settings.text_editor]
79

95.5 KB
Loading

tests/walkie-talkie.png

-7.59 KB
Loading

tests/with-settings/gear.png

95.5 KB
Loading

0 commit comments

Comments
 (0)