forked from 1b-agent/fieldcraft-upstream
Projecting a point onto one B-rep face searched one box tree over every triangle of the boundary, skipping the other faces' triangles: when other faces lie nearer the point than the target face, it walked most of the tree before reaching a triangle it could use. Smoothing a projected mesh projects every boundary node many times, onto every face of its target group, so the Pi 5 enclosure base spent 95 % of its 11 minutes there. Each face (and each face pair's curve) now has a tree of its own: the same nearest triangle, found among its own boxes only. Ties between triangles at the same distance went to whichever the tree's walk met first; they now go to the lowest triangle, so the result no longer depends on how a tree is built. With that rule the per-face trees and the whole-boundary tree give bitwise the same mesh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UhhZMBTviDQxZvwnyP89fo