From 6a780de5fdf9397edc4e635cc8cfb4aa342901f4 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 01:02:38 -0400 Subject: [PATCH] Tests: the helical groove's removed volume from the cut's exact volume, not a 0.01 mm mesh's MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit faceted_cut_of_a_helical_groove took the volume removed as the shaft's exact volume less the cut body's mesh volume at a 0.01 mm chord. That mesh sags inside the shaft's round wall: the uncut shaft's own mesh at 0.01 is 0.18 mm³ short of pi r^2 h, five times the 3 % the groove is held to, so the groove read 1.326 where the screw integral gives 1.2214 (the section's 2 pi int r dA over 4 turns plus the ramp at z = 0). The cut is a B-rep: its exact volume (measure) gives the removed volume within the 3 %. Co-Authored-By: Claude Opus 5.5 --- crates/kernel/src/thread_tests.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/kernel/src/thread_tests.rs b/crates/kernel/src/thread_tests.rs index 659f502e1b..4816ba298e 100644 --- a/crates/kernel/src/thread_tests.rs +++ b/crates/kernel/src/thread_tests.rs @@ -18,7 +18,9 @@ fn faceted_cut_of_a_helical_groove() { let section = [Vec2::new(1.2, -0.06), Vec2::new(1.6, -0.06), Vec2::new(1.6, 0.06), Vec2::new(1.2, 0.06)]; let groove = sweep_helix_mesh(&plane, §ion, base, k, p, 5.0, 48).unwrap(); let cut = faceted_boolean(&shaft, &groove, BoolOp::Cut, 1e-3).unwrap().unwrap(); - let m = cut.mesh(&crate::MeshTolerance::chord(0.01)).unwrap().measure(); + // The cut's own volume (SMLib's, of its exact faces): a mesh's at 0.01 mm sags inside the + // shaft's round wall by 0.18 mm³, five times the 3 % the groove is held to. + let m = crate::measure(&cut).unwrap(); // In the shaft from z = 0: the section (r 1.2…1.5, 0.12 tall) for 4 turns, plus the part of // the first turn's section above z = 0 (its z range is ±0.06 about the turn's height). let per_turn = 2.0 * PI * 0.12 * (1.5f64.powi(2) - 1.2f64.powi(2)) / 2.0;