dist/preview release/modules/polygonMesh/es6.js
// go through all polygon nodes and cure small local self-intersections
go through all polygon nodes and cure small local self-intersections
go through all polygon nodes and cure small local self - intersections
function cureLocalIntersections(start, triangles, dim) {
        var p = start;
        do {
            var a = p.prev, b = p.next.next;
            if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {
                triangles.push(a.i / dim);
                triangles.push(p.i / dim);
                triangles.push(b.i / dim);
                removeNode(p);
                removeNode(p.next);
                p = start = b;
            }
            p = p.next;
        } while (p !== start);
        return p;
    }
function cureLocalIntersections ( start , triangles , dim ) { var p = start ; do { var a = p . prev , b = p . next . next ; if ( ! equals ( a , b ) && intersects ( a , p , p . next , b ) && locallyInside ( a , b ) && locallyInside ( b , a ) ) { triangles . push ( a . i / dim ) ; triangles . push ( p . i / dim ) ; triangles . push ( b . i / dim ) ; removeNode ( p ) ; removeNode ( p . next ) ; p = start = b ; } p = p . next ; } while ( p !== start ) ; return p ; }
go through all polygon nodes and cure small local self-intersections
go through all polygon nodes and cure small local self - intersections
// remove two nodes involved