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

Function evalQ

js/decimation.js:555–561  ·  view source on GitHub ↗
(q, v, x, y, z)

Source from the content-addressed store, hash-verified

553 // This plane contains the edge and is perpendicular to the face,
554 // so it constrains the vertex to lie on the crease line.
555 let px = ny*edz - nz*edy;
556 let py = nz*edx - nx*edz;
557 let pz = nx*edy - ny*edx;
558 const plen = Math.sqrt(px*px + py*py + pz*pz);
559 if (plen < 1e-10) continue; // edge parallel to face normal — degenerate
560 px /= plen; py /= plen; pz /= plen;
561 const d = -(px*positions[va*3] + py*positions[va*3+1] + pz*positions[va*3+2]);
562 // Scale by sqrtW: addPlaneQ accumulates (a²,ab,…) so scaling inputs by √w yields w×(a²,ab,…)
563 addPlaneQ(quadrics, va, px*sqrtW, py*sqrtW, pz*sqrtW, d*sqrtW);
564 addPlaneQ(quadrics, vb, px*sqrtW, py*sqrtW, pz*sqrtW, d*sqrtW);

Callers 1

evalQSumFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected