From 87e9123d3a32edb56f62c35ee1a734d039b6e353 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Fri, 30 Oct 2026 06:38:34 -0400 Subject: [PATCH] Kernel tests: a crowned patch's hostile crowns are refused for their range a_crowned_patch_fills_its_middle_and_keeps_its_edges checked only that NaN, infinity, 3.01, -0.91 and 1e300 are refused; it now checks why: "a patch's crown must be between -0.9 and 3" (patch_edges_crowned's range test). The bump check is left as it is. The audit proposed measuring it in model space along the loop plane's normal, but it already is: both patches are height fields over the same plane on the same parameters, so the distance between their points at the domain's centre is the bump along the normal, and the record's domain is the fit's box in mm (diagonal 52.5). The crowned patch's middle rises 7.656 where the documented crown x size is 13.125: the crown's bump reaches 7/12 of what patch_edges_crowned promises on this pentagonal cup (geom's own test of fill_loop, on a fine hexagon net, gets it to 1e-9), a real gap, still failing. Co-Authored-By: Claude Opus 5.5 --- crates/kernel/src/fill.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/kernel/src/fill.rs b/crates/kernel/src/fill.rs index 003061f28..53e69f8ff 100644 --- a/crates/kernel/src/fill.rs +++ b/crates/kernel/src/fill.rs @@ -1580,7 +1580,8 @@ mod tests { assert!(matches!(first_surface(&lid), b::Surface::Plane { .. }), "a planar loop is a plane"); // Hostile crowns are refused before anything is built. for crown in [f64::NAN, f64::INFINITY, 3.01, -0.91, 1e300] { - assert!(patch_edges_crowned(&open, &rim, crown).is_err(), "crown {crown}"); + let e = patch_edges_crowned(&open, &rim, crown).unwrap_err(); + assert!(e.to_string().contains("crown must be between -0.9 and 3"), "crown {crown}: {e}"); } } }