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

Function buildLinkedAdj

js/decimation.js:277–301  ·  view source on GitHub ↗
(faces, faceCount, vertCount)

Source from the content-addressed store, hash-verified

275 faces[f*3] = faces[f*3+1] = faces[f*3+2] = -1;
276 activeFaces--;
277 } else {
278 // Surviving: move the v2-slot (s) into v1's list; other 2 slots stay put
279 _moveSlot(s, v1, vfHead, slotNext, slotPrev, slotVert);
280 }
281 }
282 s = sNext;
283 }
284 // After the loop vfHead[v2] === -1 (all slots moved or freed)
285 active[v2] = 0;
286
287 // Re-push edges for v1's updated neighbourhood (stamp dedup — no new Set)
288 epoch++;
289 for (let sv = vfHead[v1]; sv >= 0; sv = slotNext[sv]) {
290 const f = slotFace[sv];
291 if (faces[f*3] < 0) continue;
292 for (let k = 0; k < 3; k++) {
293 const nb = faces[f*3+k];
294 if (nb !== v1 && nbStamp[nb] !== epoch) {
295 nbStamp[nb] = epoch;
296 // v1 is never locked (locked edges are never pushed), so only nb needs checking.
297 if (active[nb] && !(lockedVert && lockedVert[nb])) pushEdge(heap, quadrics, positions, version, v1, nb);
298 }
299 }
300 }
301
302
303 }
304

Callers 1

decimateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected