mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-06 20:02:16 +00:00
Kernel tests: drop the mixed arc-and-line mitre test, the rig's 485 grades it
fillet_mixed_arc_and_line_joint_preserves_both_section_radii put R0.5 on the D prism's top outline and checked 258 points of each mitre edge against the cylinder and torus to 1e-7 in r squared, through the record's edges. The rig's fillets/485-fillet-d-prism-top-outline-arc-and-flat builds the same prism with the same radius and grades the removed volume to 5e-5 (a 0.12 mm3 loss shows) and G1 on every blend seam, which is what the mitre's accuracy is for. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -2067,8 +2067,8 @@ fn fillet_mixed_arc_and_line_removed_volume_converges() {
|
||||
}
|
||||
let blended = fillet(&body, &[Vec3::new(0.0, 10.0, 15.0), Vec3::new(5.0, 0.0, 15.0)], r).unwrap();
|
||||
// The removal from the exact volumes (SMLib's, to 1e-8): the reference to a hundred
|
||||
// thousandth (the blend's surfaces are SMLib's fits; their section error is
|
||||
// fillet_mixed_arc_and_line_joint_preserves_both_section_radii's).
|
||||
// thousandth (the blend's surfaces are SMLib's fits; the rig's
|
||||
// fillets/485-fillet-d-prism-top-outline-arc-and-flat grades the same round).
|
||||
let done = measure(&blended).unwrap();
|
||||
let exact = source.volume - done.volume;
|
||||
assert!(rel(exact, want) < 1e-5, "r={r}: removed {exact}, expected {want}");
|
||||
@@ -2082,42 +2082,6 @@ fn fillet_mixed_arc_and_line_removed_volume_converges() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fillet_mixed_arc_and_line_joint_preserves_both_section_radii() {
|
||||
let r = 0.5;
|
||||
let body = mixed_arc_and_line_prism();
|
||||
let blended = fillet(&body, &[Vec3::new(0.0, 10.0, 15.0), Vec3::new(5.0, 0.0, 15.0)], r).unwrap();
|
||||
crate::guard("inspect mixed fillet mitres", || {
|
||||
let rec = blended.record();
|
||||
let mut mitres = std::collections::HashSet::new();
|
||||
for (id, edge) in rec.edges.iter().enumerate() {
|
||||
let a = Vec3::from(rec.vertices[edge.vertices[0] as usize].point);
|
||||
let b = Vec3::from(rec.vertices[edge.vertices[1] as usize].point);
|
||||
// Only the two corner profiles join the top contact to the wall contact.
|
||||
if (a.z - b.z).abs() < r - 1e-8 || a.z.min(b.z) < 15.0 - r - 1e-8 || a.x * b.x <= 0.0 {
|
||||
continue;
|
||||
}
|
||||
if !mitres.insert(id) {
|
||||
continue;
|
||||
}
|
||||
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();
|
||||
// The joint lies on both the cylindrical line blend and the toroidal
|
||||
// arc blend, not their tangent-plane approximation.
|
||||
let radius2 = (p.y - r).powi(2) + (p.z - (15.0 - r)).powi(2);
|
||||
assert!((radius2 - r * r).abs() < 1e-7, "distorted line section at {p:?}: radius squared {radius2}");
|
||||
let radius2 = (p.x.hypot(p.y) - (10.0 - r)).powi(2) + (p.z - (15.0 - r)).powi(2);
|
||||
assert!((radius2 - r * r).abs() < 1e-7, "distorted arc section at {p:?}: radius squared {radius2}");
|
||||
}
|
||||
}
|
||||
assert_eq!(mitres.len(), 2, "both arc/line corners must be checked");
|
||||
Ok(())
|
||||
})
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn fillet_partial_mixed_arc_and_line_perimeter_run() {
|
||||
let body = partial_mixed_run_prism();
|
||||
|
||||
Reference in New Issue
Block a user