Compute the target max edge length from the brush diameter.
(brushDiameter)
| 4026 | const iz = Math.max(0, Math.min(res - 1, Math.floor((sz - minZ) / dz))); |
| 4027 | |
| 4028 | let bestDist = Infinity, bestIdx = 0; |
| 4029 | // Two-pass: prefer original faces whose normal aligns with the subdivided |
| 4030 | // face (dot > 0.4 ≈ within ~66°), then among those pick the nearest |
| 4031 | // centroid. This prevents boundary faces at sharp seams (cube edges etc.) |
| 4032 | // from being mapped to the adjacent face even when that face's centroid |
| 4033 | // happens to be closer. Falls back to pure nearest-centroid if no |
| 4034 | // normal-matching candidate is found. |
no outgoing calls
no test coverage detected