Created
July 9, 2018 16:01
-
-
Save sloriot/ddcc88f9a7fea383a586f05fca1629c3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h> | |
#include <CGAL/Surface_mesh.h> | |
#include <CGAL/Polygon_mesh_processing/corefinement.h> | |
#include <CGAL/Polygon_mesh_processing/connected_components.h> | |
#include <CGAL/Polygon_mesh_processing/stitch_borders.h> | |
#include <fstream> | |
#include <sstream> | |
typedef CGAL::Exact_predicates_inexact_constructions_kernel K; | |
typedef CGAL::Surface_mesh<K::Point_3> Surface_mesh; | |
namespace PMP = CGAL::Polygon_mesh_processing; | |
int main(int, const char** argv) | |
{ | |
std::ifstream input(argv[1]); | |
Surface_mesh tm; | |
input >> tm; | |
Surface_mesh::Property_map<Surface_mesh::Edge_index, bool> ecm = | |
tm.add_property_map<Surface_mesh::Edge_index, bool>("ecm", false).first; | |
PMP::experimental::autorefine(tm, PMP::parameters::edge_is_constrained_map(ecm)); | |
PMP::keep_largest_connected_components(tm, 1, PMP::parameters::edge_is_constrained_map(ecm)); | |
PMP::stitch_borders(tm); | |
std::ofstream output("out.off"); | |
output << std::setprecision(17); | |
output << tm; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment