From 6d42c1ddf2d07ac28dd997d2eb6ced44fdb4ec1c Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 24 Sep 2021 11:14:29 +0200 Subject: [PATCH] add warning message for the case when initialization has failed --- Mesh_3/include/CGAL/Mesh_3/Mesher_3.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h b/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h index de889e42acf..e5a78c9b56e 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesher_3.h @@ -45,6 +45,7 @@ #include #include #include +#include #ifdef CGAL_MESH_3_USE_OLD_SURFACE_RESTRICTED_DELAUNAY_UPDATE #include @@ -719,6 +720,20 @@ initialize() else #endif // CGAL_LINKED_WITH_TBB { + + if (r_c3t3_.number_of_facets() == 0) + { + CGAL::warning_fail("c3t3.number_of_facets() == 0", + "CGAL/Mesh_3/Mesher_3.h", + 725, + "Warning : The mesh refinement process can't start.\n" + "When calling refine_mesh_3(), the input `c3t3` should have been initialized and have " + "at least one facet in the complex. Try to solve this issue using :\n" + "\t- The automatic initialization provided by make_mesh_3()\n" + "\t- Adding more and better chosen points on the input surface\n" + "\t- defining the compilation macro CGAL_SEQUENTIAL_MESH_3_ADD_OUTSIDE_POINTS_ON_A_FAR_SPHERE\n"); + } + if (r_c3t3_.number_of_far_points() == 0 && r_c3t3_.number_of_facets() == 0 && (r_c3t3_.triangulation().dimension() < 3