From 7453571040e5dc8ed6a315f809661eb308a7a93c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 5 Nov 2012 16:01:17 +0000 Subject: [PATCH] Added a unittest to create the strange configuration. Still have to analyze in more detail. git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@758 fdac6126-5c0c-442c-9429-916003d36597 --- src/Unittests/unittests_add_face.hh | 48 +++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/Unittests/unittests_add_face.hh b/src/Unittests/unittests_add_face.hh index e9183f1b..c4f063c4 100644 --- a/src/Unittests/unittests_add_face.hh +++ b/src/Unittests/unittests_add_face.hh @@ -255,6 +255,54 @@ TEST_F(OpenMeshAddFaceTriangleMesh, CreateTriangleMeshCube) { } +/* Adds a quite strange configuration to the mesh + */ +TEST_F(OpenMeshAddFaceTriangleMesh, CreateStrangeConfig) { + + + Mesh::VertexHandle vh[7]; + Mesh::FaceHandle fh[4]; + + // + // 2 x-----------x 1 + // \ / + // \ / + // \ / + // \ / + // \ / + // 0 x ---x 6 + // /|\ | + // / | \ | + // / | \ | + // / | \| + // x----x x + // 3 4 5 + // + // + // + + // Add vertices + vh[0] = mesh_.add_vertex (Mesh::Point (0, 0, 0)); + vh[1] = mesh_.add_vertex (Mesh::Point (1, 1, 1)); + vh[2] = mesh_.add_vertex (Mesh::Point (2, 2, 2)); + vh[3] = mesh_.add_vertex (Mesh::Point (3, 3, 3)); + vh[4] = mesh_.add_vertex (Mesh::Point (4, 4, 4)); + vh[5] = mesh_.add_vertex (Mesh::Point (5, 5, 5)); + vh[6] = mesh_.add_vertex (Mesh::Point (6, 6, 6)); + + mesh_.add_face( vh[0], vh[1], vh[2] ); + mesh_.add_face( vh[0], vh[3], vh[4] ); + mesh_.add_face( vh[0], vh[5], vh[6] ); + + // non-manifold! + mesh_.add_face( vh[3], vh[0], vh[4] ); + + // Check setup + EXPECT_EQ(7u, mesh_.n_vertices() ) << "Wrong number of vertices"; + EXPECT_EQ(4u, mesh_.n_faces() ) << "Wrong number of faces"; + +} + /* Adds a quad to a polymesh (should be a quad afterwards) */