From 70326e3b8e61a40502e17b23bf9d9cf5bb91dbc9 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Fri, 18 Oct 2024 13:55:55 +0100 Subject: [PATCH] Read file as given in argv and write output to same stem and extension --- .../examples/Polygon_mesh_processing/acvd_example.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/acvd_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/acvd_example.cpp index 4e5e537ce12..c5e589c662e 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/acvd_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/acvd_example.cpp @@ -8,6 +8,7 @@ #include #include +#include namespace PMP = CGAL::Polygon_mesh_processing; @@ -21,7 +22,7 @@ int main(int argc, char* argv[]) { Surface_Mesh smesh; const std::string filename = (argc > 1) ? - CGAL::data_file_path(argv[1]) : + argv[1] : CGAL::data_file_path("meshes/fandisk.off"); const int nb_clusters = (argc > 2) ? atoi(argv[2]) : 3000; @@ -54,7 +55,7 @@ int main(int argc, char* argv[]) std::cout << "Uniform QEM ACVD ...." << std::endl; auto acvd_mesh_qem = PMP::acvd_qem_remeshing(smesh, nb_clusters); - CGAL::IO::write_OFF("fandisk_acvd_qem_3000.off", acvd_mesh_qem); + CGAL::IO::write_polygon_mesh( std::filesystem::path(filename).stem().string()+"_acvd_qem_"+ std::to_string(nb_clusters) + std::filesystem::path(filename).extension().string(), acvd_mesh_qem); std::cout << "Completed" << std::endl;