From 908bc756c6898dbf475b84e3cf87a65c97bb1c82 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: the matchsurf and mixed-fillet helpers read an edge on the curve its interval is on edge_at (matchsurf) and the mixed fillet mitre check evaluated `e.curve` at parameters from `e.interval`, which is the interval on the edge's NURBS form when it has one (SMLib's edges do): they picked and sampled the wrong points. They now evaluate `e.parameters()`, as the fill helpers do since aa534cc6d's fix on the kernel-geometry branch. (Both tests still fail, for their own causes: the G2/G3 match leaves a curvature jump of 2 at the seam, and SMLib's mixed blend lies 4e-7 off its section circle.) Co-Authored-By: Claude Opus 5.5 --- crates/kernel/src/matchsurf_tests.rs | 2 +- crates/kernel/src/tests.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/kernel/src/matchsurf_tests.rs b/crates/kernel/src/matchsurf_tests.rs index e7e9b0a1e..9699b8024 100644 --- a/crates/kernel/src/matchsurf_tests.rs +++ b/crates/kernel/src/matchsurf_tests.rs @@ -60,7 +60,7 @@ fn edge_at(body: &Body, p: Vec3) -> Chain { let mut best: Option<(f64, usize)> = None; for u in edges { let e = &r.edges[u.edge as usize]; - let m = CurveEval::new(&e.curve).unwrap().point(0.5 * (e.interval[0] + e.interval[1])).unwrap(); + let m = CurveEval::new(e.parameters()).unwrap().point(0.5 * (e.interval[0] + e.interval[1])).unwrap(); let d = m.dist(p); if best.is_none_or(|(b, _)| d < b) { best = Some((d, u.edge as usize)); diff --git a/crates/kernel/src/tests.rs b/crates/kernel/src/tests.rs index f054e3314..cf1718e34 100644 --- a/crates/kernel/src/tests.rs +++ b/crates/kernel/src/tests.rs @@ -1969,7 +1969,7 @@ fn fillet_mixed_arc_and_line_joint_preserves_both_section_radii() { if !mitres.insert(id) { continue; } - let curve = solidcraft_geom::brep::eval::CurveEval::new(&edge.curve).unwrap(); + let curve = solidcraft_geom::brep::eval::CurveEval::new(edge.parameters()).unwrap(); let [lo, hi] = edge.interval; for i in 0..=257 { let p = curve.point(lo + (hi - lo) * f64::from(i) / 257.0).unwrap();