Skip to content

Commit 5a35ea4

Browse files
committed
test added
1 parent 3633884 commit 5a35ea4

1 file changed

Lines changed: 28 additions & 2 deletions

File tree

source/MRTest/MRMeshBuilderTests.cpp

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ static void testBuildWithDups( const char * objMesh, int numVerts, int numComps
5050

5151
TEST( MRMesh, MeshBuildWithDups )
5252
{
53-
// this test case passed always
53+
// first 4 triangles subdivide a square with center point,
54+
// following 4 triangles subdivide the opposite side of same triangle,
55+
// all 5 points are shared,
56+
// expected that only center vetrex is duplicated and single connected component remains
5457
testBuildWithDups
5558
(
5659
"v 0 0.5 0\n"
@@ -68,7 +71,7 @@ TEST( MRMesh, MeshBuildWithDups )
6871
"f 1 4 5\n", 6, 1
6972
);
7073

71-
// this test start passing only after recent improvements (but will fail in case vertex reordering)
74+
// same situation as above with the order of triangles changed
7275
testBuildWithDups
7376
(
7477
"v 0 0.5 0\n"
@@ -85,6 +88,29 @@ TEST( MRMesh, MeshBuildWithDups )
8588
"f 1 5 4\n"
8689
"f 3 5 1\n", 6, 1
8790
);
91+
92+
// first 4 triangles subdivide a square with center point,
93+
// following 4 triangles subdivide same square with center point,
94+
// 3 points on one diagonal are shared,
95+
// it is divided properly on two components if the rings are computed from the smallest by id next triangle
96+
testBuildWithDups
97+
(
98+
"v -1 0 -1\n"
99+
"v 1 0 -1\n"
100+
"v -1 0 1\n"
101+
"v 1 0 1\n"
102+
"v -1 0 -1\n"
103+
"v 1 0 1\n"
104+
"v 0 0 0\n"
105+
"f 7 1 3\n"
106+
"f 1 7 2\n"
107+
"f 7 3 4\n"
108+
"f 2 7 4\n"
109+
"f 5 7 2\n"
110+
"f 7 3 6\n"
111+
"f 2 7 6\n"
112+
"f 7 5 3\n", 10, 2
113+
);
88114
}
89115

90116
} //namespace MeshBuilder

0 commit comments

Comments
 (0)