From 37cbdd065c0dbd493ad512b782a2321a8f16520d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 24 Jan 2017 14:19:03 +0100 Subject: [PATCH] handle the case when the ray intersection is a segment --- .../CGAL/internal/AABB_tree/AABB_ray_intersection.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h index 4f4c6f2b059..407e530a1a5 100644 --- a/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h +++ b/AABB_tree/include/CGAL/internal/AABB_tree/AABB_ray_intersection.h @@ -179,8 +179,14 @@ private: as_ray_param_visitor(const Ray* ray) : ray(ray) {} template - FT operator()(const T&) - { std::cout << "not handled" << std::endl; return FT(); } + FT operator()(const T& s) + { + // intersection is a segment, returns the min relative distance + // of its endpoints + FT r1 = this->operator()(s[0]); + FT r2 = this->operator()(s[1]); + return (std::min)(r1,r2); + } FT operator()(const Point& point) { typename AABB_traits::Geom_traits::Vector_3 x(ray->source(), point);