public void RemoveNonSurfaceFaces_InsertBox_BoxTopRemoved()
        {
            CVMesh mesh = PLYHandler.ReadMesh(testModelLocation + @"\box.ply");

            Slicer.xMin = double.MinValue;
            Slicer.xMax = double.MaxValue;
            CVMesh meshOut = uut.Slice(mesh, double.MinValue, double.MaxValue, false);
        }
        public void LaplacianFilter_BoxInserted_BoxSmoothed()
        {
            string         location    = testModelLocation + "\\box.ply";
            CVMesh         mesh        = PLYHandler.ReadMesh(location);
            List <Vector3> vertices    = mesh.Vertices;
            List <Vector3> newVertices = uut.LaplacianFilter(vertices.ToArray(), mesh.TriangleIndeces.ToArray()).ToList();

            mesh.Vertices = newVertices;
        }
        public void IdentifyPath_InsertPlane_CorrectPathOutPut()
        {
            string      location = testModelLocation + "\\plane.ply";
            CVMesh      mesh     = PLYHandler.ReadMesh(location);
            BoundingBox b        = Extensions.FindBoundingBox(mesh.Vertices);

            uut.distance_length = -(b.x_max - b.x_min) / 9f;
            uut.distance_width  = -(b.y_max - b.y_min) / 9f;
            List <VertexIndex> path = uut.CreatePath(mesh.Vertices);

            path = Extensions.PruneVertices(path);
            Assert.AreEqual(path.Count, mesh.Vertices.Count);
        }
        public void Slice_InsertFourFaces_2Returned()
        {
            //Mesh has 10 vertices, of which 8 are unique. It has 4 faces.
            //We're slicing halfway through the third face, so we should end up with 2 faces and 5 vertices.
            string location   = testModelLocation + @"\fourTriangles.ply";
            CVMesh mesh       = PLYHandler.ReadMesh(location);
            float  lowerLimit = 58.5f;
            float  upperLimit = 1000f;

            Slicer.xMin = float.MinValue;
            Slicer.xMax = float.MaxValue;
            CVMesh sliced = uut.Slice(mesh, lowerLimit, upperLimit, false);

            Assert.AreEqual(5, sliced.Vertices.Count);
            Assert.AreEqual(0, sliced.Faces[0].index1);
            Assert.AreEqual(1, sliced.Faces[0].index2);
            Assert.AreEqual(2, sliced.Faces[0].index3);
            Assert.AreEqual(3, sliced.Faces[1].index1);
            Assert.AreEqual(2, sliced.Faces[1].index2);
            Assert.AreEqual(4, sliced.Faces[1].index3);
        }
 public void FindPath_InsertFlatMeshFromCamera_OutputURPath()
 {
     string        location = testModelLocation + "\\cameraBoxScan.ply";
     CVMesh        mesh     = PLYHandler.ReadMesh(location);
     List <URPose> poses    = uut.FindPath(mesh, 2);
 }