mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-03 18:45:55 +00:00
Tests: the cap whose loops prism_measure compares is found by its plane, not as the last face
cap_support_origin_is_not_a_trimmed_face_height read the drilled block's last face as a cap. The record's face order is SMLib's: its last face can be the hole's wall, which has no cap loop, and the test unwrapped None. The cap is now the first face on a plane square to z. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -927,9 +927,15 @@ mod tests {
|
||||
}
|
||||
}
|
||||
assert_eq!(equivalent(&original, source.size(), &same, source.size()), Some(true));
|
||||
let last = original.faces.len() - 1;
|
||||
let outward = preflight(&original).unwrap()[last];
|
||||
let runs = loop_runs(&original, last, 0, outward).unwrap();
|
||||
// A cap: a face whose plane is square to z (the record's face order is SMLib's, its last
|
||||
// face may be the hole's wall).
|
||||
let cap = original
|
||||
.faces
|
||||
.iter()
|
||||
.position(|f| plane_of(&f.surface).is_some_and(|(_, u, v)| u.cross(v).normalized().is_some_and(|n| n.z.abs() > 0.9)))
|
||||
.unwrap();
|
||||
let outward = preflight(&original).unwrap()[cap];
|
||||
let runs = loop_runs(&original, cap, 0, outward).unwrap();
|
||||
assert!(
|
||||
loops_same(
|
||||
&cap_loop(&runs, &Plane::XY, 3e-9, &mut 2_000_000).unwrap(),
|
||||
|
||||
Reference in New Issue
Block a user