Fuzzer: a chamfer may add material, as a fillet may (#3868)
The fuzzer chamfers randomly picked edges and expected every chamfer to shrink the body, so a chamfer of a concave edge, which fills the corner, was reported as a wrong volume: 53 of the 6,000 designs of a run (seed 7100465: a box, a shell, a chamfer of an inside edge). Fillets already expect any volume change for the same reason; chamfers now do too. The regression test checks both directions on a shelled 20 mm box (an inside-edge chamfer of 1 mm adds 8 mm³, an outside one takes 10 mm³ away) and that seed 7100465 is no longer a volume finding. Co-authored-by: Tyler Chiriboga <18270301+Tyler-Chiriboga@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -246,7 +246,9 @@ fn next_step(r: &mut Rng, s: &Session, last_feature: &Option<String>) -> Option<
|
||||
let edges = body.body.edges(tol).ok()?;
|
||||
let n = 1 + r.below(3);
|
||||
let picks: Vec<[f64; 3]> = (0..n).filter_map(|_| edges.get(r.below(edges.len()))).map(|e| [e.mid.x, e.mid.y, e.mid.z]).collect();
|
||||
step("chamfer", Expect::Shrink, vec![("solid.chamfer", json!({"edges": picks, "distance": r.pick(&[0.5, 1.0, 2.0])?}))])
|
||||
// Any, as for fillets: the edges are picked at random, and a chamfer on a concave edge
|
||||
// fills the corner, so it adds material.
|
||||
step("chamfer", Expect::Any, vec![("solid.chamfer", json!({"edges": picks, "distance": r.pick(&[0.5, 1.0, 2.0])?}))])
|
||||
}
|
||||
8 => {
|
||||
let faces: Vec<_> = body.body.faces(tol).ok()?.into_iter().filter(|f| f.plane_normal.is_some()).collect();
|
||||
|
||||
Reference in New Issue
Block a user