Exemple #1
0
        public void MeshEdgeSplitAndUnsplitTests()
        {
            // split edge and create vert (not part of a polygon, just a wire mesh)
            {
                Mesh     testMesh    = new Mesh();
                Vertex   leftVertex  = testMesh.CreateVertex(-1, 0, 0);
                Vertex   rightVertex = testMesh.CreateVertex(1, 0, 0);
                MeshEdge edgeToSplit = testMesh.CreateMeshEdge(leftVertex, rightVertex);
                Assert.IsTrue(edgeToSplit.VertexOnEnd[0] == leftVertex, "The edgeToSplit is connected the way we expect.");
                Assert.IsTrue(edgeToSplit.VertexOnEnd[1] == rightVertex, "The edgeToSplit is connected the way we expect.");
                Assert.IsTrue(leftVertex.firstMeshEdge == edgeToSplit, "First edge of left vertex is the edge.");
                Assert.IsTrue(rightVertex.firstMeshEdge == edgeToSplit, "First edge of right vertex is the edge.");
                MeshEdge edgeCreatedDuringSplit;
                Vertex   vertexCreatedDuringSplit;
                testMesh.SplitMeshEdge(edgeToSplit, out vertexCreatedDuringSplit, out edgeCreatedDuringSplit);

                Assert.IsTrue(edgeToSplit.VertexOnEnd[1] == vertexCreatedDuringSplit);
                Assert.IsTrue(edgeToSplit.NextMeshEdgeFromEnd[0] == edgeToSplit);
                Assert.IsTrue(edgeToSplit.NextMeshEdgeFromEnd[1] == edgeCreatedDuringSplit);
                Assert.IsTrue(edgeCreatedDuringSplit.VertexOnEnd[0] == vertexCreatedDuringSplit, "The edgeCreatedDuringSplit is connected the way we expect.");
                Assert.IsTrue(edgeCreatedDuringSplit.VertexOnEnd[1] == rightVertex, "The edgeCreatedDuringSplit is connected the way we expect.");

                Assert.IsTrue(vertexCreatedDuringSplit.firstMeshEdge == edgeCreatedDuringSplit, "First edge of new vertex is the edge we split.");
                Assert.IsTrue(edgeCreatedDuringSplit.NextMeshEdgeFromEnd[0] == edgeToSplit, "The next edge is the one we created.");
                Assert.IsTrue(edgeCreatedDuringSplit.NextMeshEdgeFromEnd[1] == edgeCreatedDuringSplit, "The other side is connected to itself.");

                testMesh.UnsplitMeshEdge(edgeToSplit, vertexCreatedDuringSplit);
                Assert.IsTrue(edgeCreatedDuringSplit.VertexOnEnd[0] == null && edgeCreatedDuringSplit.VertexOnEnd[1] == null, "The edgeCreatedDuringSplit is no longer connected to Vertices.");
                Assert.IsTrue(edgeToSplit.VertexOnEnd[0] == leftVertex, "The unsplit edge is connected back the way it was.");
                Assert.IsTrue(edgeToSplit.VertexOnEnd[1] == rightVertex, "The unsplit edge is connected back the way it was.");
            }

            // split a polygon's edge and create vert
            {
                Mesh   testMesh    = new Mesh();
                Vertex leftVertex  = testMesh.CreateVertex(-1, 0, 1);
                Vertex rightVertex = testMesh.CreateVertex(1, 0, 1);
                Vertex topVertex   = testMesh.CreateVertex(-1, 0, -1);
                Face   newFace     = testMesh.CreateFace(new Vertex[] { rightVertex, topVertex, leftVertex });

                Assert.IsTrue(newFace.normal == Vector3.UnitY);

                Assert.IsTrue(newFace.NumVertices == 3, "We have a 3 vertex face.");
                Assert.IsTrue(newFace.FaceEdgeLoopIsGood());

                MeshEdge edgeToSplit = testMesh.FindMeshEdges(leftVertex, rightVertex)[0];
                Assert.IsTrue(edgeToSplit.VertexOnEnd[0] == leftVertex, "The edgeToSplit is connected the way we expect.");
                Assert.IsTrue(edgeToSplit.VertexOnEnd[1] == rightVertex, "The edgeToSplit is connected the way we expect.");

                MeshEdge edgeCreatedDuringSplit;
                Vertex   vertexCreatedDuringSplit;
                SaveDebugInfo(testMesh);
                testMesh.SplitMeshEdge(edgeToSplit, out vertexCreatedDuringSplit, out edgeCreatedDuringSplit);
                SaveDebugInfo(testMesh);

                Assert.IsTrue(newFace.NumVertices == 4, "After SplitEdge it is a 4 vertex face.");
                Assert.IsTrue(newFace.FaceEdgeLoopIsGood());

                Assert.IsTrue(edgeCreatedDuringSplit.firstFaceEdge != null, "First face edge is connected.");
                Assert.IsTrue(edgeCreatedDuringSplit.firstFaceEdge.meshEdge == edgeCreatedDuringSplit, "The new face edge is connected to the created mesh edge.");
                Assert.IsTrue(edgeCreatedDuringSplit.VertexOnEnd[0] != null && edgeCreatedDuringSplit.VertexOnEnd[1] != null, "The edgeCreatedDuringSplit is connected to Vertices.");
                Assert.IsTrue(edgeCreatedDuringSplit.VertexOnEnd[0].GetConnectedMeshEdges().Contains(edgeCreatedDuringSplit), "The vertex connected to this mesh edege contains this mesh edge.");
                //Assert.IsTrue(edgeCreatedDuringSplit.VertexOnEnd[1].GetConnectedMeshEdges().Contains(edgeCreatedDuringSplit), "The vertex connected to this mesh edege contains this mesh edge.");

                testMesh.UnsplitMeshEdge(edgeToSplit, vertexCreatedDuringSplit);

                Assert.IsTrue(newFace.FaceEdgeLoopIsGood());

                Assert.IsTrue(newFace.NumVertices == 3, "Back to 3 after UnsplitEdge.");

                Assert.IsTrue(edgeCreatedDuringSplit.firstFaceEdge == null, "First face edge is disconnected.");
                Assert.IsTrue(edgeCreatedDuringSplit.VertexOnEnd[0] == null && edgeCreatedDuringSplit.VertexOnEnd[1] == null, "The edgeCreatedDuringSplit is no longer connected to Vertices.");
                Assert.IsTrue(edgeToSplit.VertexOnEnd[0] == leftVertex, "The unsplit edge is connected back the way it was.");
                Assert.IsTrue(edgeToSplit.VertexOnEnd[1] == rightVertex, "The unsplit edge is connected back the way it was.");

                // split again then unsplit the created edge rather than the original edge
                testMesh.SplitMeshEdge(edgeToSplit, out vertexCreatedDuringSplit, out edgeCreatedDuringSplit);

                testMesh.UnsplitMeshEdge(edgeCreatedDuringSplit, vertexCreatedDuringSplit);

                Assert.IsTrue(newFace.FaceEdgeLoopIsGood());

                Assert.IsTrue(newFace.NumVertices == 3, "Back to 3 after UnsplitEdge.");

                Assert.IsTrue(edgeToSplit.firstFaceEdge == null, "First face edge is disconnected.");
                Assert.IsTrue(edgeToSplit.VertexOnEnd[0] == null && edgeToSplit.VertexOnEnd[1] == null, "The edgeToSplit is no longer connected to Vertices.");
                Assert.IsTrue(edgeCreatedDuringSplit.VertexOnEnd[0] == leftVertex, "The unsplit edge is connected back the way it was.");
                Assert.IsTrue(edgeCreatedDuringSplit.VertexOnEnd[1] == rightVertex, "The unsplit edge is connected back the way it was.");
            }

            // make sure that the data on FaceEdges is correct (split the center edge of an extruded plus).
            {
                // make an extruded pluss sign.
                Mesh   testMesh     = new Mesh();
                Vertex centerVertex = testMesh.CreateVertex(0, 0, 0);
                Vertex leftVertex   = testMesh.CreateVertex(-1, 0, 0);
                Vertex rightVertex  = testMesh.CreateVertex(1, 0, 0);
                Vertex frontVertex  = testMesh.CreateVertex(0, -1, 0);
                Vertex backVertex   = testMesh.CreateVertex(0, 1, 0);

                Vertex centerVertexTop = testMesh.CreateVertex(0, 0, 1);
                Vertex leftVertexTop   = testMesh.CreateVertex(-1, 0, 1);
                Vertex rightVertexTop  = testMesh.CreateVertex(1, 0, 1);
                Vertex frontVertexTop  = testMesh.CreateVertex(0, -1, 1);
                Vertex backVertexTop   = testMesh.CreateVertex(0, 1, 1);

                testMesh.CreateFace(new Vertex[] { centerVertex, centerVertexTop, frontVertexTop, frontVertex });
                MeshEdge centerEdge = testMesh.FindMeshEdges(centerVertex, centerVertexTop)[0];
                Assert.IsTrue(centerEdge.GetNumFacesSharingEdge() == 1, "There should be 1 faces on this edge.");
                testMesh.CreateFace(new Vertex[] { centerVertex, centerVertexTop, rightVertexTop, rightVertex });
                Assert.IsTrue(centerEdge.GetNumFacesSharingEdge() == 2, "There should be 2 faces on this edge.");
                testMesh.CreateFace(new Vertex[] { centerVertex, centerVertexTop, backVertexTop, backVertex });
                Assert.IsTrue(centerEdge.GetNumFacesSharingEdge() == 3, "There should be 3 faces on this edge.");
                testMesh.CreateFace(new Vertex[] { centerVertex, centerVertexTop, leftVertexTop, leftVertex });
                Assert.IsTrue(centerEdge.GetNumFacesSharingEdge() == 4, "There should be 4 faces on this edge.");

                foreach (Face face in centerEdge.FacesSharingMeshEdgeIterator())
                {
                    Assert.IsTrue(face.NumVertices == 4, "The faces should all have 4 vertices.");
                }

                Vertex   createdVertx;
                MeshEdge createdEdge;
                testMesh.SplitMeshEdge(centerEdge, out createdVertx, out createdEdge);
                Assert.IsTrue(centerEdge.GetNumFacesSharingEdge() == 4, "There should still be 4 faces on this edge.");
                Assert.IsTrue(createdEdge.GetNumFacesSharingEdge() == 4, "There should be 4 faces on this new edge.");
                foreach (Face face in centerEdge.FacesSharingMeshEdgeIterator())
                {
                    Assert.IsTrue(face.NumVertices == 5, "The faces should all now have 5 vertices.");
                }

                testMesh.UnsplitMeshEdge(centerEdge, createdVertx);
                Assert.IsTrue(centerEdge.GetNumFacesSharingEdge() == 4, "There should again be 4 faces on this edge.");
                foreach (Face face in centerEdge.FacesSharingMeshEdgeIterator())
                {
                    Assert.IsTrue(face.NumVertices == 4, "The faces should all finally have 4 vertices.");
                }
            }

            // make sure that the data on FaceEdges is correct (split the center edge of an extruded plus).
            if (false)
            {
                Mesh   testMesh     = new Mesh();
                Vertex centerVertex = testMesh.CreateVertex(0, 0, 0);
                Vertex leftVertex   = testMesh.CreateVertex(-1, 0, 0);
                Vertex rightVertex  = testMesh.CreateVertex(1, 0, 0);

                Vertex centerVertexTop = testMesh.CreateVertex(0, 0, 1);
                Vertex leftVertexTop   = testMesh.CreateVertex(-1, 0, 1);
                Vertex rightVertexTop  = testMesh.CreateVertex(1, 0, 1);

                testMesh.CreateFace(new Vertex[] { centerVertex, centerVertexTop, leftVertexTop, leftVertex });
                MeshEdge centerEdge = testMesh.FindMeshEdges(centerVertex, centerVertexTop)[0];
                Assert.IsTrue(centerEdge.GetNumFacesSharingEdge() == 1, "There should be 1 faces on this edge.");
                testMesh.CreateFace(new Vertex[] { centerVertexTop, centerVertex, rightVertex, rightVertexTop });
                Assert.IsTrue(centerEdge.GetNumFacesSharingEdge() == 2, "There should be 2 faces on this edge.");

                foreach (Face face in centerEdge.FacesSharingMeshEdgeIterator())
                {
                    Assert.IsTrue(face.NumVertices == 4, "The faces should all have 4 vertices.");
                }

                SaveDebugInfo(testMesh);
                testMesh.CleanAndMergMesh();
                SaveDebugInfo(testMesh);

                Vertex   createdVertx;
                MeshEdge createdEdge;
                testMesh.SplitMeshEdge(centerEdge, out createdVertx, out createdEdge);
                SaveDebugInfo(testMesh);
                Assert.IsTrue(centerEdge.GetNumFacesSharingEdge() == 4, "There should still be 4 faces on this edge.");
                Assert.IsTrue(createdEdge.GetNumFacesSharingEdge() == 4, "There should be 4 faces on this new edge.");
                foreach (Face face in centerEdge.FacesSharingMeshEdgeIterator())
                {
                    Assert.IsTrue(face.NumVertices == 5, "The faces should all now have 5 vertices.");
                }

                testMesh.CleanAndMergMesh();

                testMesh.UnsplitMeshEdge(centerEdge, createdVertx);
                Assert.IsTrue(centerEdge.GetNumFacesSharingEdge() == 4, "There should again be 4 faces on this edge.");
                foreach (Face face in centerEdge.FacesSharingMeshEdgeIterator())
                {
                    Assert.IsTrue(face.NumVertices == 4, "The faces should all finally have 4 vertices.");
                }

                testMesh.CleanAndMergMesh();
            }
        }
Exemple #2
0
        public void MeshFaceSplitAndUnspiltTests()
        {
            {
                //                              centerVertexTop (0, 0, 2)
                //
                //
                //
                //
                // leftVertexBottom (-1, 0, 0)  centerVertexBottom (0, 0, 0)  rightVertexBottom (1, 0, 0)

                Mesh   testMesh           = new Mesh();
                Vertex leftVertexBottom   = testMesh.CreateVertex(-1, 0, 0);
                Vertex centerVertexBottom = testMesh.CreateVertex(0, 0, 0);
                Vertex rightVertexBottom  = testMesh.CreateVertex(1, 0, 0);
                Vertex centerVertexTop    = testMesh.CreateVertex(0, 0, 1);
                Face   originalFace       = testMesh.CreateFace(new Vertex[] { leftVertexBottom, centerVertexBottom, rightVertexBottom, centerVertexTop });

                SaveDebugInfo(testMesh);
                //       *
                //      / \
                //     /   \
                //    /     \
                //   /       \
                //  *----*----*

                Assert.IsTrue(testMesh.FindMeshEdges(leftVertexBottom, centerVertexBottom).Count == 1);
                MeshEdge firstFaceEdgeMeshEdge = testMesh.FindMeshEdges(leftVertexBottom, centerVertexBottom)[0];
                Assert.IsTrue(originalFace.firstFaceEdge.meshEdge == firstFaceEdgeMeshEdge);
                Assert.IsTrue(originalFace.NumVertices == 4, "The original face has 4 vertices.");
                MeshEdge edgeLeftCenter  = testMesh.FindMeshEdges(leftVertexBottom, centerVertexBottom)[0];
                MeshEdge edgeCenterRight = testMesh.FindMeshEdges(centerVertexBottom, rightVertexBottom)[0];
                MeshEdge edgeTopLeft     = testMesh.FindMeshEdges(centerVertexTop, leftVertexBottom)[0];
                MeshEdge edgeRightTop    = testMesh.FindMeshEdges(centerVertexTop, rightVertexBottom)[0];

                Assert.IsTrue(edgeTopLeft.NextMeshEdgeFromEnd[0] == edgeRightTop);
                Assert.IsTrue(edgeTopLeft.NextMeshEdgeFromEnd[1] == edgeLeftCenter);

                Assert.IsTrue(centerVertexBottom.GetConnectedMeshEdgesCount() == 2);

                string connectionInfoBeforeSplit = testMesh.GetConnectionInfoAsString();

                // split the face and test the result
                Face     faceCreatedDuringSplit;
                MeshEdge meshEdgeCreatedDuringSplit;
                testMesh.SplitFace(originalFace, centerVertexBottom, centerVertexTop, out meshEdgeCreatedDuringSplit, out faceCreatedDuringSplit);
                SaveDebugInfo(testMesh);
                //       *
                //      /|\
                //     / | \
                //    /  |  \
                //   /   |   \
                //  *----*----*

                testMesh.Validate();
                //Debug.Write(testMesh.GetConnectionInfoAsString());

                Assert.IsTrue(meshEdgeCreatedDuringSplit.VertexOnEnd[0] == centerVertexBottom);
                Assert.IsTrue(meshEdgeCreatedDuringSplit.VertexOnEnd[1] == centerVertexTop);
                Assert.IsTrue(edgeLeftCenter.NextMeshEdgeFromEnd[1] == meshEdgeCreatedDuringSplit);
                Assert.IsTrue(edgeTopLeft.NextMeshEdgeFromEnd[1] == edgeLeftCenter);
                Assert.IsTrue(originalFace.firstFaceEdge.meshEdge == meshEdgeCreatedDuringSplit);
                Assert.IsTrue(originalFace.NumVertices == 3, "The original face now has 3 vertices.");
                Assert.IsTrue(centerVertexBottom.GetConnectedMeshEdgesCount() == 3);
                Assert.IsTrue(meshEdgeCreatedDuringSplit.GetNumFacesSharingEdge() == 2, "The edge we split on now has 2 faces attached to it.");
                Assert.IsTrue(centerVertexBottom.GetConnectedMeshEdgesCount() == 3, "The vertex we split on should now have 3 mesh edges attached to it.");
                Assert.IsTrue(centerVertexTop.GetConnectedMeshEdgesCount() == 3, "The vertex we split on should now have 3 mesh edges attached to it.");
                Assert.IsTrue(leftVertexBottom.GetConnectedMeshEdgesCount() == 2, "The original vertices should still have 2 mesh edges attached to them.");
                Assert.IsTrue(rightVertexBottom.GetConnectedMeshEdgesCount() == 2, "The original vertices should still have 2 mesh edges attached to them.");
                Assert.IsTrue(faceCreatedDuringSplit.NumVertices == 3, "The created now has 3 vertices.");

                // Unsplit the faces keeping the original face, and test the result.
                testMesh.UnsplitFace(originalFace, faceCreatedDuringSplit, meshEdgeCreatedDuringSplit);
                SaveDebugInfo(testMesh);
                //       *
                //      / \
                //     /   \
                //    /     \
                //   /       \
                //  *----*----*
                string connectionInfoAfterUnsplit = testMesh.GetConnectionInfoAsString();
                testMesh.Validate();
                foreach (FaceEdge faceEdge in originalFace.FaceEdges())
                {
                    // make sure none of them are connected to the deleted MeshEdge
                    Assert.IsTrue(faceEdge.meshEdge != meshEdgeCreatedDuringSplit);
                    Assert.IsTrue(faceEdge.meshEdge.NextMeshEdgeFromEnd[0] != meshEdgeCreatedDuringSplit);
                    Assert.IsTrue(faceEdge.meshEdge.NextMeshEdgeFromEnd[1] != meshEdgeCreatedDuringSplit);
                }
                //Debug.Write(testMesh.GetConnectionInfoAsString());
                Assert.IsTrue(originalFace.NumVertices == 4, "The original face is back to 4 vertices.");
                Assert.IsTrue(meshEdgeCreatedDuringSplit.firstFaceEdge == null, "The data for the deleted edge is all null to help debugging.");
                Assert.IsTrue(meshEdgeCreatedDuringSplit.VertexOnEnd[0] == null, "The data for the deleted edge is all null to help debugging.");
                Assert.IsTrue(meshEdgeCreatedDuringSplit.NextMeshEdgeFromEnd[0] == null, "The data for the deleted edge is all null to help debugging.");
                Assert.IsTrue(meshEdgeCreatedDuringSplit.VertexOnEnd[1] == null, "The data for the deleted edge is all null to help debugging.");
                Assert.IsTrue(meshEdgeCreatedDuringSplit.NextMeshEdgeFromEnd[1] == null, "The data for the deleted edge is all null to help debugging.");
                Assert.IsTrue(faceCreatedDuringSplit.firstFaceEdge == null, "The data for the deleted face is all null to help debugging.");

                Assert.IsTrue(centerVertexBottom.GetConnectedMeshEdgesCount() == 2, "The vertex we split on should now have 2 mesh edges attached to it.");
                Assert.IsTrue(centerVertexTop.GetConnectedMeshEdgesCount() == 2, "The vertex we split on should now have 2 mesh edges attached to it.");
            }

            {
                Mesh   testMesh          = new Mesh();
                Vertex leftVertexBottom  = testMesh.CreateVertex(-1, 0, 0);
                Vertex rightVertexBottom = testMesh.CreateVertex(1, 0, 0);
                Vertex leftVertexCenter  = testMesh.CreateVertex(-1, 0, 1);
                Vertex rightVertexCenter = testMesh.CreateVertex(1, 0, 1);
                Vertex leftVertexTop     = testMesh.CreateVertex(-1, 0, 2);
                Vertex rightVertexTop    = testMesh.CreateVertex(1, 0, 2);
                Face   originalFace      = testMesh.CreateFace(new Vertex[] { rightVertexBottom, rightVertexCenter, rightVertexTop, leftVertexTop, leftVertexCenter, leftVertexBottom });
                SaveDebugInfo(testMesh);
                // *-------*
                // |       |
                // *       *
                // |       |
                // *-------*

                MeshEdge bottomEdge = testMesh.FindMeshEdges(leftVertexBottom, rightVertexBottom)[0];
                Assert.IsTrue(bottomEdge.GetNumFacesSharingEdge() == 1);
                Assert.IsTrue(originalFace.NumVertices == 6);

                // split the face and test the result
                Face     faceCreatedDuringSplit;
                MeshEdge edgeCreatedDuringSplit;
                testMesh.SplitFace(originalFace, rightVertexCenter, leftVertexCenter, out edgeCreatedDuringSplit, out faceCreatedDuringSplit);
                SaveDebugInfo(testMesh);
                // *-------*
                // |       |
                // *-------*
                // |       |
                // *-------*

                Assert.IsTrue(edgeCreatedDuringSplit.GetNumFacesSharingEdge() == 2, "The edge we split on now has 2 faces attached to it.");
                Assert.IsTrue(leftVertexCenter.GetConnectedMeshEdgesCount() == 3, "The vertex we split on should now have 3 mesh edges attached to it.");
                Assert.IsTrue(rightVertexCenter.GetConnectedMeshEdgesCount() == 3, "The vertex we split on should now have 3 mesh edges attached to it.");
                Assert.IsTrue(leftVertexBottom.GetConnectedMeshEdgesCount() == 2, "The original vertices should still have 2 mesh edges attached to them.");
                Assert.IsTrue(leftVertexTop.GetConnectedMeshEdgesCount() == 2, "The original vertices should still have 2 mesh edges attached to them.");
                Assert.IsTrue(rightVertexBottom.GetConnectedMeshEdgesCount() == 2, "The original vertices should still have 2 mesh edges attached to them.");
                Assert.IsTrue(rightVertexTop.GetConnectedMeshEdgesCount() == 2, "The original vertices should still have 2 mesh edges attached to them.");
                Assert.IsTrue(originalFace.NumVertices == 4, "The original face still has 4 vertices.");
                Assert.IsTrue(faceCreatedDuringSplit.NumVertices == 4, "The created face has 4 vertices.");

                // Unsplit the faces keeping the original face, and test the result.
                testMesh.UnsplitFace(originalFace, faceCreatedDuringSplit, edgeCreatedDuringSplit);
                SaveDebugInfo(testMesh);
                // *-------*
                // |       |
                // *       *
                // |       |
                // *-------*
                Assert.IsTrue(originalFace.NumVertices == 6, "The original face still has 4 vertices.");
                Assert.IsTrue(edgeCreatedDuringSplit.firstFaceEdge == null, "The data for the deleted edge is all null to help debugging.");
                Assert.IsTrue(edgeCreatedDuringSplit.VertexOnEnd[0] == null, "The data for the deleted edge is all null to help debugging.");
                Assert.IsTrue(edgeCreatedDuringSplit.NextMeshEdgeFromEnd[0] == null, "The data for the deleted edge is all null to help debugging.");
                Assert.IsTrue(edgeCreatedDuringSplit.VertexOnEnd[1] == null, "The data for the deleted edge is all null to help debugging.");
                Assert.IsTrue(edgeCreatedDuringSplit.NextMeshEdgeFromEnd[1] == null, "The data for the deleted edge is all null to help debugging.");
                Assert.IsTrue(faceCreatedDuringSplit.firstFaceEdge == null, "The data for the deleted face is all null to help debugging.");
                Assert.IsTrue(leftVertexCenter.GetConnectedMeshEdgesCount() == 2, "The vertex we split on should now have 2 mesh edges attached to it.");
                Assert.IsTrue(rightVertexCenter.GetConnectedMeshEdgesCount() == 2, "The vertex we split on should now have 2 mesh edges attached to it.");

                // split the face again and test the result
                testMesh.SplitFace(originalFace, rightVertexCenter, leftVertexCenter, out edgeCreatedDuringSplit, out faceCreatedDuringSplit);
                Assert.IsTrue(edgeCreatedDuringSplit.GetNumFacesSharingEdge() == 2, "The edge we split on now has 2 faces attached to it.");
                Assert.IsTrue(leftVertexCenter.GetConnectedMeshEdgesCount() == 3, "The vertex we split on should now have 3 mesh edges attached to it.");
                Assert.IsTrue(rightVertexCenter.GetConnectedMeshEdgesCount() == 3, "The vertex we split on should now have 3 mesh edges attached to it.");
                Assert.IsTrue(leftVertexBottom.GetConnectedMeshEdgesCount() == 2, "The vertex we split on should now have 2 mesh edges attached to it.");
                Assert.IsTrue(rightVertexBottom.GetConnectedMeshEdgesCount() == 2, "The vertex we split on should now have 2 mesh edges attached to it.");

                // unsplite the faces keeping the face we created and test the result
                testMesh.UnsplitFace(faceCreatedDuringSplit, originalFace, edgeCreatedDuringSplit);
                Assert.IsTrue(faceCreatedDuringSplit.NumVertices == 6, "The created face has 4 vertices.");
            }
        }