Add plumbus test (#1975)
* add plumbus test Signed-off-by: Jess Frazelle <github@jessfraz.com> * plumbus image Signed-off-by: Jess Frazelle <github@jessfraz.com> * twenty twenty Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 86 KiB |
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 81 KiB |
@ -1848,3 +1848,66 @@ const part002 = startSketchOn(part001, 'end')
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
twenty_twenty::assert_image("tests/executor/outputs/simple_revolve_sketch_on_edge.png", &result, 1.0);
|
twenty_twenty::assert_image("tests/executor/outputs/simple_revolve_sketch_on_edge.png", &result, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test(flavor = "multi_thread")]
|
||||||
|
async fn serial_test_plumbus_fillets() {
|
||||||
|
let code = r#"fn make_circle = (face, tag, pos, radius) => {
|
||||||
|
const sg = startSketchOn(face, tag)
|
||||||
|
|> startProfileAt([pos[0] + radius, pos[1]], %)
|
||||||
|
|> arc({
|
||||||
|
angle_end: 360,
|
||||||
|
angle_start: 0,
|
||||||
|
radius: radius
|
||||||
|
}, %, 'arc-' + tag)
|
||||||
|
|> close(%)
|
||||||
|
|
||||||
|
return sg
|
||||||
|
}
|
||||||
|
|
||||||
|
fn pentagon = (len) => {
|
||||||
|
const sg = startSketchOn('XY')
|
||||||
|
|> startProfileAt([-len / 2, -len / 2], %)
|
||||||
|
|> angledLine({ angle: 0, length: len }, %, 'a')
|
||||||
|
|> angledLine({
|
||||||
|
angle: segAng('a', %) + 180 - 108,
|
||||||
|
length: len
|
||||||
|
}, %, 'b')
|
||||||
|
|> angledLine({
|
||||||
|
angle: segAng('b', %) + 180 - 108,
|
||||||
|
length: len
|
||||||
|
}, %, 'c')
|
||||||
|
|> angledLine({
|
||||||
|
angle: segAng('c', %) + 180 - 108,
|
||||||
|
length: len
|
||||||
|
}, %, 'd')
|
||||||
|
|> angledLine({
|
||||||
|
angle: segAng('d', %) + 180 - 108,
|
||||||
|
length: len
|
||||||
|
}, %)
|
||||||
|
|
||||||
|
return sg
|
||||||
|
}
|
||||||
|
|
||||||
|
const p = pentagon(8)
|
||||||
|
|> extrude(5, %)
|
||||||
|
|
||||||
|
const plumbus0 = make_circle(p, 'a', [0, 0], 1.5)
|
||||||
|
|> extrude(3, %)
|
||||||
|
|> fillet({
|
||||||
|
radius: 0.5,
|
||||||
|
tags: ['arc-a', getOppositeEdge('arc-a', %)]
|
||||||
|
}, %)
|
||||||
|
|
||||||
|
const plumbus1 = make_circle(p, 'b', [0, 0], 1.5)
|
||||||
|
|> extrude(3, %)
|
||||||
|
|> fillet({
|
||||||
|
radius: 0.5,
|
||||||
|
tags: ['arc-b', getOppositeEdge('arc-b', %)]
|
||||||
|
}, %)
|
||||||
|
"#;
|
||||||
|
|
||||||
|
let result = execute_and_snapshot(code, kittycad::types::UnitLength::Mm)
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
twenty_twenty::assert_image("tests/executor/outputs/plumbus_fillets.png", &result, 1.0);
|
||||||
|
}
|
||||||
|
BIN
src/wasm-lib/tests/executor/outputs/plumbus_fillets.png
Normal file
After Width: | Height: | Size: 101 KiB |