From 4a0f4536d6b8f6651a8c04054b4e54d3ccd30ca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Thu, 19 Sep 2019 14:23:15 +0200 Subject: [PATCH] Make it possible to pass a value for the stop criterion --- .../edge_collapse_bounded_normal_change.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp index da9fa48583e..0202551fb93 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/edge_collapse_bounded_normal_change.cpp @@ -24,11 +24,10 @@ int main(int argc, char** argv) // This is a stop predicate (defines when the algorithm terminates). // In this example, the simplification stops when the number of undirected edges // left in the surface mesh drops below the specified number (1000) - SMS::Count_stop_predicate stop(num_halfedges(surface_mesh)/2 - 1); + SMS::Count_stop_predicate stop((argc > 2) ? std::stod(argv[2]) : num_halfedges(surface_mesh)/2 - 1); typedef SMS::Bounded_normal_change_placement > Placement; - // This the actual call to the simplification algorithm. // The surface mesh and stop conditions are mandatory arguments. // The index maps are needed because the vertices and edges @@ -38,7 +37,7 @@ int main(int argc, char** argv) CGAL::parameters::get_cost(SMS::LindstromTurk_cost()) .get_placement(Placement())); - std::ofstream os(argc > 2 ? argv[2] : "out.off"); + std::ofstream os(argc > 3 ? argv[3] : "out.off"); os.precision(17); os << surface_mesh;