Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
globals.warn("No valid geometry found in SVG, be sure to ungroup all and remove all clipping masks.");
return false;
}
foldData = FOLD.filter.collapseNearbyVertices(foldData, globals.vertTol);
foldData = FOLD.filter.removeLoopEdges(foldData);//remove edges that points to same vertex
foldData = FOLD.filter.removeDuplicateEdges_vertices(foldData);//remove duplicate edges
// foldData = FOLD.filter.subdivideCrossingEdges_vertices(foldData, globals.vertTol);//find intersections and add vertices/edges
foldData = findIntersections(foldData, globals.vertTol);
//cleanup after intersection operation
foldData = FOLD.filter.collapseNearbyVertices(foldData, globals.vertTol);
foldData = FOLD.filter.removeLoopEdges(foldData);//remove edges that points to same vertex
foldData = FOLD.filter.removeDuplicateEdges_vertices(foldData);//remove duplicate edges
foldData = FOLD.convert.edges_vertices_to_vertices_vertices_unsorted(foldData);
foldData = removeStrayVertices(foldData);//delete stray anchors
foldData = removeRedundantVertices(foldData, 0.01);//remove vertices that split edge
foldData.vertices_vertices = FOLD.convert.sort_vertices_vertices(foldData);
foldData = FOLD.convert.vertices_vertices_to_faces_vertices(foldData);
foldData = edgesVerticesToVerticesEdges(foldData);
foldData = removeBorderFaces(foldData);//expose holes surrounded by all border edges
foldData = reverseFaceOrder(foldData);//set faces to counter clockwise
return processFold(foldData);
}
function processFold(fold, returnCreaseParams){
rawFold = JSON.parse(JSON.stringify(fold));//save pre-triangulated for for save later
//make 3d
for (var i=0;i0) {
fold = splitCuts(fold);
fold = FOLD.convert.edges_vertices_to_vertices_vertices_unsorted(fold);
fold = removeRedundantVertices(fold, 0.01);//remove vertices that split edge
}
delete fold.vertices_vertices;
delete fold.vertices_edges;
foldData = triangulatePolys(fold, true);
for (var i=0;i