From 319e6b8b3bbd4935cd8d3134190f16bfcbaa91e1 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 29 Oct 2026 00:47:33 -0400 Subject: [PATCH] Kernel tests: the chamfer on a tangent wall junction is measured on meshes fine enough MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit chamfer_the_top_lip_at_a_tangent_wall_junction measured the removed volume as the difference of two meshes at chord 0.0005. The display planner meshes the two bodies differently, so their chord errors no longer cancel as truck's meshes did: 37.404, 37.672, 37.761 and 37.759 mm³ at chords 0.002, 0.0005, 0.0001 and 0.00003, converging on the expected 37.762 (the chamfer as the chord between the contact lines of a 2 mm ball, integrated exactly). SMLib's chamfer is that one; the test measures at chord 0.0001. Co-Authored-By: Claude Opus 5.5 --- crates/kernel/tests/chamfer_curved_holder.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/kernel/tests/chamfer_curved_holder.rs b/crates/kernel/tests/chamfer_curved_holder.rs index 7006535f0..f45ab14a6 100644 --- a/crates/kernel/tests/chamfer_curved_holder.rs +++ b/crates/kernel/tests/chamfer_curved_holder.rs @@ -59,7 +59,12 @@ fn chamfer_the_top_lip_at_a_tangent_wall_junction() { assert_eq!(made.crossed_face_loops().unwrap(), 0); let history = made.history().expect("the chamfer retains exact face provenance"); assert!(history.faces.iter().any(|f| f.origins.iter().any(|o| matches!(o, solidcraft_kernel::history::FaceOrigin::Edge { operand: 0, .. })))); - let mesh = |body: &Body| body.mesh(&solidcraft_kernel::MeshTolerance::chord(0.0005)).unwrap(); + // Fine enough that the meshes' chord error is below the tolerance: the removed volume + // measured on meshes is 37.404 at chord 0.002, 37.672 at 0.0005, 37.761 at 0.0001 and 37.759 + // at 0.00003, converged on the expected 37.762 (the chamfer as the chord between the contacts + // of a 2 mm ball). The planner's meshes of the two bodies differ, so their chord errors no + // longer cancel as truck's did. + let mesh = |body: &Body| body.mesh(&solidcraft_kernel::MeshTolerance::chord(0.0001)).unwrap(); let before = mesh(&body).measure().volume; let after = mesh(&made); let removed = before - after.measure().volume;