Press Pull on a fillet's or chamfer's face edits that feature's size by the distance (found through the face's persistent name); on another curved face it offsets the face, with the rest of its surface (both halves of a hole's wall)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AS5Tn3xieewUSg3uxrMVdL
This commit is contained in:
bherbruckandClaude Opus 5.5 committed 2026-10-08 13:39:34 +00:00
1 parent 59b59a83e6
commit 06186be555
5 files changed
+106

No files matched your search

+19
View File
@@ -32,6 +32,25 @@ pub(super) fn face_normal(s: &Session, p: Vec3) -> Option<Vec3> {
.find_map(|[a, b, c]| (b - a).cross(c - a).normalized())
}
/// Is the body face at `p` planar (`None`: no face there)?
pub(super) fn face_is_planar(s: &Session, p: Vec3) -> Option<bool> {
let (m, f, d) = face_at(s, p)?;
let tol = (m.bounds().diagonal() * 1e-3).max(1e-3);
if d > tol * 10.0 {
return None;
}
let ns: Vec<Vec3> = m
.triangles
.iter()
.zip(&m.tri_face)
.filter(|(_, tf)| **tf == f)
.filter_map(|(t, _)| m.tri(t))
.filter_map(|[a, b, c]| (b - a).cross(c - a).normalized())
.collect();
let n0 = *ns.first()?;
Some(ns.iter().all(|n| n.dot(n0) > 1.0 - 1e-6))
}
/// The body face under a point: (mesh, face index, distance).
fn face_at(s: &Session, p: Vec3) -> Option<(std::sync::Arc<Mesh>, u32, f64)> {
let st = s.model.state();