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:
Tyler Chiriboga
2026-10-21 18:56:51 +00:00
committed by GitHub
parent ac1768e08b
commit 915ee8a178
2 changed files with 30 additions and 1 deletions
+3 -1
View File
@@ -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();