diff --git a/src/OpenMesh/Core/Mesh/PolyConnectivity.cc b/src/OpenMesh/Core/Mesh/PolyConnectivity.cc index 1302a20d..30a6b64e 100644 --- a/src/OpenMesh/Core/Mesh/PolyConnectivity.cc +++ b/src/OpenMesh/Core/Mesh/PolyConnectivity.cc @@ -284,6 +284,12 @@ PolyConnectivity::add_face(const VertexHandle* _vertex_handles, size_t _vhs_size //----------------------------------------------------------------------------- bool PolyConnectivity::is_collapse_ok(HalfedgeHandle v0v1) { + //is edge already deleteed? + if (status(edge_handle(v0v1)).deleted()) + { + return false; + } + HalfedgeHandle v1v0(opposite_halfedge_handle(v0v1)); VertexHandle v0(to_vertex_handle(v1v0)); VertexHandle v1(to_vertex_handle(v0v1)); @@ -304,12 +310,6 @@ bool PolyConnectivity::is_collapse_ok(HalfedgeHandle v0v1) VertexHandle v_10_p = from_vertex_handle(prev_halfedge_handle(v1v0)); VertexHandle v_10_n = to_vertex_handle(next_halfedge_handle(v1v0)); - //is edge already deleteed? - if (status(edge_handle(v0v1)).deleted()) - { - return false; - } - //are the vertices already deleted ? if (status(v0).deleted() || status(v1).deleted()) { diff --git a/src/OpenMesh/Core/Mesh/TriConnectivity.cc b/src/OpenMesh/Core/Mesh/TriConnectivity.cc index c786caa9..c8b24906 100644 --- a/src/OpenMesh/Core/Mesh/TriConnectivity.cc +++ b/src/OpenMesh/Core/Mesh/TriConnectivity.cc @@ -84,6 +84,10 @@ TriConnectivity::add_face(const VertexHandle* _vertex_handles, size_t _vhs_size) //----------------------------------------------------------------------------- bool TriConnectivity::is_collapse_ok(HalfedgeHandle v0v1) { + // is the edge already deleted? + if ( status(edge_handle(v0v1)).deleted() ) + return false; + HalfedgeHandle v1v0(opposite_halfedge_handle(v0v1)); VertexHandle v0(to_vertex_handle(v1v0)); VertexHandle v1(to_vertex_handle(v0v1));