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

Function checkPrecisionOutdated

js/main.js:4236–4248  ·  view source on GitHub ↗

Show/hide the "outdated" badge when brush size changes while precision is active.

()

Source from the content-addressed store, hash-verified

4234 const nrm = geometry.attributes.normal.array;
4235
4236 // Vertex-dedup pass: assign a numeric ID to each unique quantised position.
4237 const QUANT = 1e4;
4238 const dedupMap = new QuantizedPointMap(QUANT, Math.min(count, 1 << 22));
4239 let nextId = 0;
4240 const vertId = new Uint32Array(count);
4241 for (let i = 0; i < count; i++) {
4242 const id = dedupMap.getOrSet(pos[i*3], pos[i*3+1], pos[i*3+2], nextId);
4243 if (dedupMap.inserted) nextId++;
4244 vertId[i] = id;
4245 }
4246
4247 // Accumulate area-weighted buffer normals per unique position into flat arrays.
4248 // The subdivision pipeline splits indexed vertices at sharp dihedral edges
4249 // (>30 deg) so the interpolated buffer normals are smooth across soft edges
4250 // (cylinder, sphere) but sharp across hard edges (cube). Using these buffer
4251 // normals instead of geometric face normals eliminates visible faceting steps

Callers 1

wireEventsFunction · 0.85

Calls 1

Tested by

no test coverage detected