diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp index 53549abea5f..3ffede53c30 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_surface_mesh.cpp @@ -35,7 +35,8 @@ int main(int argc, char** argv) // In this example, the simplification stops when the number of undirected edges // drops below 10% of the initial count - SMS::Count_ratio_stop_predicate stop(0.05); + double stop_ratio = (argc > 2) ? std::stod(argv[2]) : 0.1; + SMS::Count_ratio_stop_predicate stop(stop_ratio); int r = SMS::edge_collapse(surface_mesh, stop); @@ -44,7 +45,7 @@ int main(int argc, char** argv) std::cout << "\nFinished!\n" << r << " edges removed.\n" << surface_mesh.number_of_edges() << " final edges.\n"; std::cout << "Time elapsed: " << std::chrono::duration_cast(end_time - start_time).count() << "ms" << std::endl; - std::ofstream os(argc > 2 ? argv[2] : "out.off"); + std::ofstream os(argc > 3 ? argv[3] : "out.off"); os.precision(17); os << surface_mesh;