mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-03 02:25:55 +00:00
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 <noreply@anthropic.com>
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user