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>
This commit is contained in:
Jess Frazelle
2024-03-29 15:06:11 -07:00
committed by GitHub
parent b0417114af
commit 509e372ed2
5 changed files with 63 additions and 0 deletions

View File

@ -1848,3 +1848,66 @@ const part002 = startSketchOn(part001, 'end')
.unwrap();
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);
}