From a6bccbca4047bd1162bd854b32f7f96da0b3c8a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Mon, 20 Jun 2016 14:43:57 +0200 Subject: [PATCH] handle the case when source and target are in the interior of the same edge --- .../Surface_mesh_shortest_path.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h index 2abd60700ad..52faa515f57 100644 --- a/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h +++ b/Surface_mesh_shortest_path/include/CGAL/Surface_mesh_shortest_path/Surface_mesh_shortest_path.h @@ -1564,15 +1564,16 @@ private: case Cone_tree_node::EDGE_SOURCE: { Segment_2 entrySegment = current->entry_segment(); - Ray_2 rayToLocation(construct_ray_2(current->source_image(), currentLocation)); + Point_2 currentSourceImage = current->source_image(); + Ray_2 rayToLocation(construct_ray_2(currentSourceImage, currentLocation)); LineLineIntersectResult cgalIntersection = intersect_2(construct_line_2(entrySegment), construct_line_2(rayToLocation)); CGAL_assertion(bool(cgalIntersection)); - Point_2* result = boost::get(&*cgalIntersection); + const Point_2* result = boost::get(&*cgalIntersection); - CGAL_assertion(result && "Error, did not get point intersection on path walk to source"); + if (!result) result = ¤tSourceImage; FT t0 = parametric_distance_along_segment_2(construct_source_2(entrySegment), construct_target_2(entrySegment), *result);