Skip to content

Commit

Permalink
Edge swaps working
Browse files Browse the repository at this point in the history
  • Loading branch information
pierotofy committed Feb 13, 2022
1 parent bcf69b3 commit 886b249
Show file tree
Hide file tree
Showing 4 changed files with 696 additions and 689 deletions.
13 changes: 10 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ void saveFinal(const std::string &filename, int thread, float edgeSwapThreshold)
writePly(filename, thread);
logWriter(" done!\n");
}else{
// Before saving to PLY, we perform edge collapses
logWriter("Performing edge collapses...\n");

JMesh::init();
Triangulation tin;

Expand All @@ -229,9 +230,15 @@ void saveFinal(const std::string &filename, int thread, float edgeSwapThreshold)
}

tin.eulerUpdate();
tin.verticalEdgeTagging(edgeSwapThreshold);
tin.iterativeEdgeSwaps();
tin.removeUnlinkedElements();
tin.mergeCoincidentEdges();
tin.removeDegenerateTriangles();

tin.saveOBJ("/data/drone/brighton2/odm_meshing/tmp/out.obj");
logWriter("SAVED OBJ!\n");
logWriter("Writing to file... ");
tin.savePLY(filename.c_str(), false);
logWriter(" done!\n");
}
}

Expand Down
Loading

0 comments on commit 886b249

Please sign in to comment.