From 98284eb1e19148b668638f97a5dcd2bd19046501 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Wed, 28 Oct 2026 22:20:34 -0400 Subject: [PATCH] Tests: a box thinner than a body's tolerance may be refused instead of getting no certificate prism_measure's uncertain-material check built a 20 x 20 x 1e-5 box and asked that it get no cap certificate. SMLib refuses that box (its loops fail SMLib's orientation check): at 1e-5 it is half a body's tolerance (2e-5) thick, no solid. Refused or built without a certificate, the property holds. Co-Authored-By: Claude Opus 5.5 --- crates/kernel/src/prism_measure.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/kernel/src/prism_measure.rs b/crates/kernel/src/prism_measure.rs index 346a6fb0f..41036f34b 100644 --- a/crates/kernel/src/prism_measure.rs +++ b/crates/kernel/src/prism_measure.rs @@ -956,8 +956,10 @@ mod tests { let region = solidcraft_geom::Loop2::polygon(&[Vec2::ZERO, Vec2::new(20., 0.), Vec2::new(20., 20.), Vec2::new(0., 20.)]); let doubled = CapLoop { segments: region.segs.iter().chain(®ion.segs).copied().collect(), area: Interval::enclosing(800., 1e-8).unwrap() }; assert!(separated_material(&[doubled], 1e-6, &mut 16_000_000).is_none()); - let thin = crate::box_solid(Vec3::ZERO, Vec3::new(20., 20., 1e-5)).unwrap(); - assert!(cert(&thin, 3e-6).is_none()); + // Thinner than a body's tolerance (2e-5): SMLib refuses it as a solid; built, it gets none. + if let Ok(thin) = crate::box_solid(Vec3::ZERO, Vec3::new(20., 20., 1e-5)) { + assert!(cert(&thin, 3e-6).is_none()); + } } #[test]