diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt index f04497557b7..3574c6e9a22 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt @@ -107,7 +107,7 @@ create_single_source_cgal_program("test_simplify_polylines_pmp.cpp") create_single_source_cgal_program("triangulate_hole_with_cdt_2_test.cpp") create_single_source_cgal_program("test_pmp_polyhedral_envelope.cpp") create_single_source_cgal_program("test_pmp_np_function.cpp") -create_single_source_cgal_program("test_degenerate_pmp_clip.cpp") +create_single_source_cgal_program("test_degenerate_pmp_clip_split_corefine.cpp") # create_single_source_cgal_program("test_pmp_repair_self_intersections.cpp") find_package(METIS) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_degenerate_pmp_clip.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_degenerate_pmp_clip_split_corefine.cpp similarity index 83% rename from Polygon_mesh_processing/test/Polygon_mesh_processing/test_degenerate_pmp_clip.cpp rename to Polygon_mesh_processing/test/Polygon_mesh_processing/test_degenerate_pmp_clip_split_corefine.cpp index 3137d984dd0..9562d946222 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/test_degenerate_pmp_clip.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/test_degenerate_pmp_clip_split_corefine.cpp @@ -3,7 +3,7 @@ #include #include -#define CGAL_DEBUG_PMP_CLIP +// #define CGAL_DEBUG_PMP_CLIP // TODO: test coref // TODO: test throw coref and clip @@ -25,6 +25,26 @@ void test() auto run_a_test = [&i] (std::string f, double a, double b, double c, double d) { std::cout << "running test " << i << "\n"; + { + std::cout << " test clip with throw\n"; + TriangleMesh tm; + std::ifstream(f) >> tm; + try{ + PMP::clip(tm, K::Plane_3(a,b,c,d), params::throw_on_self_intersection(true)); + } + catch(PMP::Corefinement::Self_intersection_exception&) + {} + } + + { + std::cout << " test split with SI allowed\n"; + TriangleMesh tm; + std::ifstream(f) >> tm; + PMP::split(tm, K::Plane_3(a,b,c,d), params::allow_self_intersections(true)); + } + + { + std::cout << " test clip with SI allowed\n"; TriangleMesh tm; std::ifstream(f) >> tm; #ifdef CGAL_DEBUG_PMP_CLIP @@ -34,6 +54,8 @@ void test() #ifdef CGAL_DEBUG_PMP_CLIP std::ofstream("/tmp/output_"+std::to_string(i)+".off") << std::setprecision(17) << tm; #endif + } + ++i; };