From 16bef10974ebbba73704541ffc4a71c63d2b320f Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Sat, 31 Oct 2026 08:56:06 -0400 Subject: [PATCH] Shell regression: the saddle-corner shell opened on the top box's side has its exact volume Co-Authored-By: Claude Opus 5.5 --- crates/engine/tests/shell_regressions.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/engine/tests/shell_regressions.rs b/crates/engine/tests/shell_regressions.rs index 213ee9146a..3abd8b70c6 100644 --- a/crates/engine/tests/shell_regressions.rs +++ b/crates/engine/tests/shell_regressions.rs @@ -46,6 +46,13 @@ fn shell_box_on_box_overhanging_saddle_corner() { let mut s = box_on_box(2.5); run(&mut s, "solid.shell", json!({"faces": [[7.5, 17.5, 38.75]], "thickness": 1.5})); sound(&s); + // The bottom closed and the top box's left face x = 7.5 open, so the cavity in the top box + // runs out to it: [1.5, 23.5] × [1.5, 16] × [1.5, 33.5] in the lower box, + // [7.5, 21] × [1.5, 16] × [33.5, 41] over it and [7.5, 21] × [16, 18.5] × [36.5, 41] in the + // overhang, out of the solid's 25 × 17.5 × 35 + 15 × 20 × 7.5. + let want = 25.0 * 17.5 * 35.0 + 15.0 * 20.0 * 7.5 - 22.0 * 14.5 * 32.0 - 13.5 * 14.5 * 7.5 - 13.5 * 2.5 * 4.5; + let got = volume(&s); + assert!((got - want).abs() < 1e-6 * want, "shell volume {got}, want {want}"); } /// The same saddle corner with the bottom open: every face round the corner moves, and the