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

Method constructor

js/decimation.js:713–726  ·  view source on GitHub ↗
(initialCap = 65536)

Source from the content-addressed store, hash-verified

711 for (let f = 0; f < faceCount; f++) {
712 if (faces[f * 3] >= 0) activeFaces++;
713 }
714
715 const posArray = new Float32Array(activeFaces * 9);
716 let out = 0;
717 for (let f = 0; f < faceCount; f++) {
718 if (faces[f * 3] < 0) continue;
719 for (let v = 0; v < 3; v++) {
720 const vi = faces[f * 3 + v];
721 posArray[out++] = positions[vi * 3];
722 posArray[out++] = positions[vi * 3 + 1];
723 posArray[out++] = positions[vi * 3 + 2];
724 }
725 }
726
727 // Compute exact per-face normals from the final positions so winding order
728 // always agrees with the stored normals (computeVertexNormals averages across
729 // shared positions and can flip normals on excluded surfaces).

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected