From b9d0a330802a848404f116721cbe08f1ce49e3de Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 21:51:09 -0400 Subject: [PATCH] Mesh memo test: SMLib's booleans mesh neither operand The test cut three regions from a plate that keeps its meshes and expected the memo to hold one mesh afterwards: the old kernel's booleans meshed their operands. On SMLib (ops::boolean -> smlib_boolean, since 42c41464a) a boolean reads the exact record and a tool apart from the body is found from the exact boxes, so no boolean meshes anything and the memo is empty after them. The test now asserts that, then that meshing the kept body twice at one tolerance makes one memo entry, bit-equal to a fresh mesh, which is the reuse the memo is for. Fixes kernel body::mesh_memo_tests::regions_cut_from_a_body_keeping_its_meshes_are_unchanged. Co-Authored-By: Claude Opus 5.5 --- crates/kernel/src/mesh_memo_tests.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/kernel/src/mesh_memo_tests.rs b/crates/kernel/src/mesh_memo_tests.rs index 55bb81c5b..adef8c548 100644 --- a/crates/kernel/src/mesh_memo_tests.rs +++ b/crates/kernel/src/mesh_memo_tests.rs @@ -14,8 +14,9 @@ fn plate() -> Body { plate } -/// Regions cut from a body that keeps its meshes come out as from the body itself, to the bit, -/// and the body is meshed once for all of them. +/// Regions cut from a body that keeps its meshes come out as from the body itself, to the bit. +/// SMLib's booleans read the exact record and mesh neither operand, so they leave the memo +/// empty; the body's own meshing then fills it once per tolerance and reuses it. #[test] fn regions_cut_from_a_body_keeping_its_meshes_are_unchanged() { let plate = plate(); @@ -35,10 +36,11 @@ fn regions_cut_from_a_body_keeping_its_meshes_are_unchanged() { ); } let memo = kept.meshes.as_ref().unwrap(); - assert_eq!(memo.made.lock().unwrap().len(), 1, "one tolerance, one meshing"); + assert_eq!(memo.made.lock().unwrap().len(), 0, "a boolean meshes neither operand"); // A mesh from the memo is the mesh made afresh. let (a, b) = (kept.mesh(&crate::MeshTolerance::chord(0.05)).unwrap(), plate.mesh(&crate::MeshTolerance::chord(0.05)).unwrap()); let (a2, _) = (kept.mesh(&crate::MeshTolerance::chord(0.05)).unwrap(), ()); + assert_eq!(memo.made.lock().unwrap().len(), 1, "one tolerance, one meshing"); for m in [&a, &a2] { assert_eq!(m.triangles, b.triangles); assert!(