From dd383da30713bd3122893bf26e61b5fa7a5de328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 7 Sep 2023 17:33:17 +0200 Subject: [PATCH 1/3] avoid an infinite loop in the case the source of the ray in on the face --- Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h index 17e69ff984c..2b5ccccacad 100644 --- a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h @@ -612,7 +612,11 @@ public: return pair.second == 0 ? Subdomain() : Subdomain(Subdomain_index(pair.second)); - default: /* COPLANAR */ continue; // loop + default: /* COPLANAR */ + if (!triangle.has_on(p)) + continue; // loop + else + return Subdomain(Subdomain_index((std::max)(pair.first,pair.second))); // make a canonical choice } // end switch on the orientation } // opt } // end while(true) From ed521e03b0d3b5a8006f5828cc75d66dcfa19ecc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 7 Sep 2023 17:33:41 +0200 Subject: [PATCH 2/3] rename macro --- Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h index 2b5ccccacad..3c53b56f401 100644 --- a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h @@ -523,8 +523,8 @@ public: return r_domain_.bounding_aabb_tree_ptr()-> first_intersected_primitive(ray); } - -#if USE_ALL_INTERSECTIONS +#define CGAL_USE_ALL_INTERSECTIONS 0 +#if CGAL_USE_ALL_INTERSECTIONS boost::optional shoot_a_ray_2(const Ray_3 ray) const { const Point_3& p = ray.source(); typedef typename AABB_tree:: @@ -551,7 +551,7 @@ public: return it->second; } } -#endif // USE_ALL_INTERSECTIONS +#endif // CGAL_USE_ALL_INTERSECTIONS Subdomain operator()(const Point_3& p) const { if(r_domain_.bounding_aabb_tree_ptr() == 0) return Subdomain(); @@ -573,8 +573,7 @@ public: const Ray_3 ray_shot = ray(p, vector(CGAL::ORIGIN,*random_point)); -#define USE_ALL_INTERSECTIONS 0 -#if USE_ALL_INTERSECTIONS +#if CGAL_USE_ALL_INTERSECTIONS boost::optional opt = shoot_a_ray_2(ray_shot); #else // first_intersected_primitive boost::optional opt = shoot_a_ray_1(ray_shot); From b2c6cec8af7bac6f007d7a19384008bf3c49fa8a Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Tue, 12 Sep 2023 11:08:21 +0200 Subject: [PATCH 3/3] A missing ref Co-authored-by: Andreas Fabri --- Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h index 3c53b56f401..835940944c7 100644 --- a/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h +++ b/Mesh_3/include/CGAL/Polyhedral_complex_mesh_domain_3.h @@ -525,7 +525,7 @@ public: } #define CGAL_USE_ALL_INTERSECTIONS 0 #if CGAL_USE_ALL_INTERSECTIONS - boost::optional shoot_a_ray_2(const Ray_3 ray) const { + boost::optional shoot_a_ray_2(const Ray_3& ray) const { const Point_3& p = ray.source(); typedef typename AABB_tree:: template Intersection_and_primitive_id::Type Inter_and_prim;