Sheet metal: a fold's fixed point on the sheet's face counts as on it (#685) (#958)

On a large thin sheet the probes around the fixed point stepped clean through
the sheet (twice the mesh tolerance of a 465 mm part is more than its 0.8 mm
thickness), so a point exactly on the face touched no material and the fold
was refused. The probes now also step a quarter of the thickness.

Co-authored-by: jonaswre <3731681+jonaswre@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
authored and GitHub committed 2026-10-14 00:14:49 -04:00
1 parent 00fdcf3e72
commit 63095fedb3
2 files changed
+27 -2

No files matched your search

+5 -2
View File
@@ -345,9 +345,12 @@ fn on_sheet_material(st: &ModelState, i: usize, p: Vec3) -> bool {
if mesh.triangles.is_empty() {
return true;
}
// Twice the display mesh's chord tolerance (see `ModelBody::mesh`).
// Twice the display mesh's chord tolerance (see `ModelBody::mesh`), and a quarter of the
// thickness: on a large thin sheet the first steps from a point on its face clean through
// it, so a point on the face would touch nothing (#685).
let step = 2.0 * (mb.body.size() * 1e-3).max(1e-3);
let offsets = [-step, 0.0, step];
let thin = st.sheets.get(i).map_or(step, |sh| (sh.t * 0.25).min(step));
let offsets = [-step, -thin, 0.0, thin, step];
offsets.iter().any(|&dx| offsets.iter().any(|&dy| offsets.iter().any(|&dz| mesh.contains(p + Vec3::new(dx, dy, dz)))))
}