MCPcopy Index your code
hub / github.com/microsoft/SandDance / cureLocalIntersections

Function cureLocalIntersections

docs/app/js/sanddance-app.js:101834–101850  ·  view source on GitHub ↗
(start, triangles, dim)

Source from the content-addressed store, hash-verified

101832 return true;
101833}
101834function cureLocalIntersections(start, triangles, dim) {
101835 let p = start;
101836 do {
101837 const a = p.prev;
101838 const b = p.next.next;
101839 if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {
101840 triangles.push(a.i / dim);
101841 triangles.push(p.i / dim);
101842 triangles.push(b.i / dim);
101843 removeNode(p);
101844 removeNode(p.next);
101845 p = start = b;
101846 }
101847 p = p.next;
101848 }while (p !== start);
101849 return filterPoints(p);
101850}
101851function splitEarcut(start, triangles, dim, minX, minY, invSize) {
101852 let a = start;
101853 do {

Callers 1

earcutLinkedFunction · 0.70

Calls 5

equalsFunction · 0.70
intersectsFunction · 0.70
locallyInsideFunction · 0.70
removeNodeFunction · 0.70
filterPointsFunction · 0.70

Tested by

no test coverage detected