From 4897ce17b47cc282a0216573f76cf9bf198db459 Mon Sep 17 00:00:00 2001 From: jyviko <2501648+jyviko@users.noreply.github.com> Date: Thu, 22 Oct 2026 07:36:06 -0400 Subject: [PATCH] kernel: loft rails tests measure against the record's surfaces (not built: base in progress) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_017itGh5fpMEousnZ91cYcVt --- crates/kernel/src/loft_rails_tests.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/kernel/src/loft_rails_tests.rs b/crates/kernel/src/loft_rails_tests.rs index 4755dfee2b..a978100eb8 100644 --- a/crates/kernel/src/loft_rails_tests.rs +++ b/crates/kernel/src/loft_rails_tests.rs @@ -42,15 +42,15 @@ fn volume(b: &crate::Body) -> f64 { b.volume_at(1e-4).unwrap() } -/// How far `p` is from the nearest face of the body. +/// How far `p` is from the nearest face's surface of the body. fn off(b: &crate::Body, p: Vec3) -> f64 { - use truck_modeling::{ParametricSurface, SearchNearestParameter}; - b.solid - .face_iter() + b.record() + .faces + .iter() .filter_map(|f| { - let s = f.surface(); - let (u, v) = s.search_nearest_parameter(crate::body::p3(p), None, 100)?; - Some(crate::body::from_p3(s.subs(u, v)).dist(p)) + let s = solidcraft_geom::brep::eval::SurfaceEval::new(&f.surface).ok()?; + let uv = s.project(p, None, f64::INFINITY)?; + Some(s.point(uv)?.dist(p)) }) .fold(f64::INFINITY, f64::min) }