MCPcopy Create free account
hub / github.com/CNCKitchen/stlTexturizer / computePrecisionEdgeLength

Function computePrecisionEdgeLength

js/main.js:4028–4031  ·  view source on GitHub ↗

Compute the target max edge length from the brush diameter.

(brushDiameter)

Source from the content-addressed store, hash-verified

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.

Callers 2

refreshPrecisionMeshFunction · 0.85
checkPrecisionOutdatedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected