add helix (#1892)
* add helix Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: ubuntu) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * u[pdates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes for camera and batch Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix; Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
2654
src/wasm-lib/tests/executor/inputs/riddle.kcl
Normal file
2654
src/wasm-lib/tests/executor/inputs/riddle.kcl
Normal file
File diff suppressed because it is too large
Load Diff
@ -542,6 +542,82 @@ const pt2 = b2.value[0]
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn serial_test_helix_defaults() {
|
||||
let code = r#"const part001 = startSketchOn('XY')
|
||||
|> circle([5, 5], 10, %)
|
||||
|> extrude(10, %)
|
||||
|> helix({revolutions: 16, angle_start: 0}, %)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm)
|
||||
.await
|
||||
.unwrap();
|
||||
twenty_twenty::assert_image("tests/executor/outputs/helix_defaults.png", &result, 1.0);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn serial_test_helix_defaults_negative_extrude() {
|
||||
let code = r#"const part001 = startSketchOn('XY')
|
||||
|> circle([5, 5], 10, %)
|
||||
|> extrude(-10, %)
|
||||
|> helix({revolutions: 16, angle_start: 0}, %)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm)
|
||||
.await
|
||||
.unwrap();
|
||||
twenty_twenty::assert_image(
|
||||
"tests/executor/outputs/helix_defaults_negative_extrude.png",
|
||||
&result,
|
||||
1.0,
|
||||
);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn serial_test_helix_ccw() {
|
||||
let code = r#"const part001 = startSketchOn('XY')
|
||||
|> circle([5, 5], 10, %)
|
||||
|> extrude(10, %)
|
||||
|> helix({revolutions: 16, angle_start: 0, ccw: true}, %)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm)
|
||||
.await
|
||||
.unwrap();
|
||||
twenty_twenty::assert_image("tests/executor/outputs/helix_ccw.png", &result, 1.0);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn serial_test_helix_with_length() {
|
||||
let code = r#"const part001 = startSketchOn('XY')
|
||||
|> circle([5, 5], 10, %)
|
||||
|> extrude(10, %)
|
||||
|> helix({revolutions: 16, angle_start: 0, length: 3}, %)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm)
|
||||
.await
|
||||
.unwrap();
|
||||
twenty_twenty::assert_image("tests/executor/outputs/helix_with_length.png", &result, 1.0);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn serial_test_dimensions_match() {
|
||||
let code = r#"const part001 = startSketchOn('XY')
|
||||
|> startProfileAt([-10, -10], %)
|
||||
|> line([20, 0], %)
|
||||
|> line([0, 20], %)
|
||||
|> line([-20, 0], %)
|
||||
|> close(%)
|
||||
"#;
|
||||
|
||||
let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm)
|
||||
.await
|
||||
.unwrap();
|
||||
twenty_twenty::assert_image("tests/executor/outputs/dimensions_match.png", &result, 1.0);
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
async fn serial_test_close_arc() {
|
||||
let code = r#"const center = [0,0]
|
||||
|
BIN
src/wasm-lib/tests/executor/outputs/dimensions_match.png
Normal file
BIN
src/wasm-lib/tests/executor/outputs/dimensions_match.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 101 KiB |
BIN
src/wasm-lib/tests/executor/outputs/helix_ccw.png
Normal file
BIN
src/wasm-lib/tests/executor/outputs/helix_ccw.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 127 KiB |
BIN
src/wasm-lib/tests/executor/outputs/helix_defaults.png
Normal file
BIN
src/wasm-lib/tests/executor/outputs/helix_defaults.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 127 KiB |
Binary file not shown.
After Width: | Height: | Size: 125 KiB |
BIN
src/wasm-lib/tests/executor/outputs/helix_with_length.png
Normal file
BIN
src/wasm-lib/tests/executor/outputs/helix_with_length.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 108 KiB |
Reference in New Issue
Block a user