fix "relink failed" condition
closes #1244 git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@1220 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
@@ -176,17 +176,19 @@ PolyConnectivity::add_face(const VertexHandle* _vertex_handles, size_t _vhs_size
|
|||||||
do
|
do
|
||||||
boundary_prev =
|
boundary_prev =
|
||||||
opposite_halfedge_handle(next_halfedge_handle(boundary_prev));
|
opposite_halfedge_handle(next_halfedge_handle(boundary_prev));
|
||||||
while (!is_boundary(boundary_prev) || boundary_prev==inner_prev);
|
while (!is_boundary(boundary_prev));
|
||||||
boundary_next = next_halfedge_handle(boundary_prev);
|
boundary_next = next_halfedge_handle(boundary_prev);
|
||||||
assert(is_boundary(boundary_prev));
|
|
||||||
assert(is_boundary(boundary_next));
|
|
||||||
// ok ?
|
// ok ?
|
||||||
if (boundary_next == inner_next)
|
if (boundary_prev == inner_prev)
|
||||||
{
|
{
|
||||||
omerr() << "PolyMeshT::add_face: patch re-linking failed\n";
|
omerr() << "PolyMeshT::add_face: patch re-linking failed\n";
|
||||||
return InvalidFaceHandle;
|
return InvalidFaceHandle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
assert(is_boundary(boundary_prev));
|
||||||
|
assert(is_boundary(boundary_next));
|
||||||
|
|
||||||
// other halfedges' handles
|
// other halfedges' handles
|
||||||
patch_start = next_halfedge_handle(inner_prev);
|
patch_start = next_halfedge_handle(inner_prev);
|
||||||
patch_end = prev_halfedge_handle(inner_next);
|
patch_end = prev_halfedge_handle(inner_next);
|
||||||
|
|||||||
@@ -296,11 +296,12 @@ TEST_F(OpenMeshAddFaceTriangleMesh, CreateStrangeConfig) {
|
|||||||
mesh_.add_face( vh[0], vh[5], vh[6] );
|
mesh_.add_face( vh[0], vh[5], vh[6] );
|
||||||
|
|
||||||
// non-manifold!
|
// non-manifold!
|
||||||
mesh_.add_face( vh[3], vh[0], vh[4] );
|
Mesh::FaceHandle invalidFH = mesh_.add_face( vh[3], vh[0], vh[4] );
|
||||||
|
|
||||||
// Check setup
|
// Check setup
|
||||||
EXPECT_EQ(7u, mesh_.n_vertices() ) << "Wrong number of vertices";
|
EXPECT_EQ(7u, mesh_.n_vertices() ) << "Wrong number of vertices";
|
||||||
EXPECT_EQ(4u, mesh_.n_faces() ) << "Wrong number of faces";
|
EXPECT_EQ(3u, mesh_.n_faces() ) << "Wrong number of faces";
|
||||||
|
EXPECT_EQ(invalidFH, Mesh::InvalidFaceHandle ) << "non manifold face is valid";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user