From d4f88fd138f776650c9a113afb55e6556a60983c Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 10 Apr 2014 15:09:09 +0200 Subject: [PATCH] bugfix. endleft and endright were not initialized if the surface has a border --- .../Policies/Edge_collapse/Edge_profile_impl.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_profile_impl.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_profile_impl.h index 45d7fd84060..d93c0560c4a 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_profile_impl.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_profile_impl.h @@ -135,16 +135,16 @@ void Edge_profile::Extract_triangles_and_link() { // look at the two faces or holes adjacent to edge (v0,v1) // and at the opposite vertex if it exists - edge_descriptor endleft, endright; + edge_descriptor endleft = next_edge(v1_v0(), surface_mesh()); + edge_descriptor endright = next_edge(v0_v1(), surface_mesh()); + if(vL() != vertex_descriptor()){ mLink.push_back(vL()); mTriangles.push_back(Triangle(v0(),v1(),vL()) ) ; - endright = next_edge(v0_v1(), surface_mesh()); } if(vR() != vertex_descriptor()){ mLink.push_back(vR()); mTriangles.push_back(Triangle(v1(),v0(),vR()) ) ; - endleft = next_edge(v1_v0(), surface_mesh()); } // counterclockwise around v0 edge_descriptor e02 = opposite_edge(prev_edge(v0_v1(),surface_mesh()), surface_mesh()); @@ -165,7 +165,7 @@ void Edge_profile::Extract_triangles_and_link() mLink.push_back(v); } - // vounterclockwise around v1 + // counterclockwise around v1 e02 = opposite_edge(prev_edge(v1_v0(),surface_mesh()), surface_mesh()); v2 =target(e02,surface_mesh()); while(e02 != endright) {