diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/acvd_remeshing_example.cpp b/Polygon_mesh_processing/examples/Polygon_mesh_processing/acvd_remeshing_example.cpp index d6e7122e99e..fcda59dd19e 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/acvd_remeshing_example.cpp +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/acvd_remeshing_example.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include @@ -34,6 +35,16 @@ int main(int argc, char* argv[]) return EXIT_FAILURE; } + ///// make sure the input is a single connected component, + ///// otherwise the input must be decomposed + auto fcm = smesh.add_property_map("fcm", 0).first; + std::size_t nbcc = PMP::connected_components(smesh, fcm); + if (nbcc!=1) + { + std::cerr << "The input is not a single connected component mesh." << std::endl; + return EXIT_FAILURE; + } + ///// Uniform Isotropic ACVD std::cout << "Uniform Isotropic ACVD ...." << std::endl; Mesh acvd_mesh = smesh;