From e658918cca952c1b4b50f18ec7c71f78937da7e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 20 Jun 2012 14:50:15 +0000 Subject: [PATCH] Fixed bug in halfedge normal computation, where a boundary halfedge was not correctly handled and caused a segfault. git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@599 fdac6126-5c0c-442c-9429-916003d36597 --- src/OpenMesh/Core/Mesh/PolyMeshT.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/OpenMesh/Core/Mesh/PolyMeshT.cc b/src/OpenMesh/Core/Mesh/PolyMeshT.cc index 4e0c0950..2e0b5ed9 100644 --- a/src/OpenMesh/Core/Mesh/PolyMeshT.cc +++ b/src/OpenMesh/Core/Mesh/PolyMeshT.cc @@ -255,14 +255,17 @@ calc_halfedge_normal(HalfedgeHandle _heh, const double _feature_angle) const { heh = Kernel::opposite_halfedge_handle(_heh); - do - { - fhs.push_back(Kernel::face_handle(heh)); + if ( !Kernel::is_boundary(heh) ) { + do + { - heh = Kernel::prev_halfedge_handle(heh); - heh = Kernel::opposite_halfedge_handle(heh); + fhs.push_back(Kernel::face_handle(heh)); + + heh = Kernel::prev_halfedge_handle(heh); + heh = Kernel::opposite_halfedge_handle(heh); + } + while(!Kernel::is_boundary(heh) && !is_estimated_feature_edge(heh, _feature_angle)); } - while(!Kernel::is_boundary(heh) && !is_estimated_feature_edge(heh, _feature_angle)); } Normal n(0,0,0);