Пример #1
0
 public void AddFace_NonManifold_ShouldThrowException()
 {
     var vertices = new[] { new Point3D(0, 0, 0), new Point3D(1, 0, 0), new Point3D(1, 1, 0), new Point3D(0, 1, 0) };
     var mesh = new HalfEdgeMesh(vertices);
     mesh.AddFace(0, 1, 2);
     mesh.AddFace(0, 1, 2);
 }
Пример #2
0
        public void AddFace_NonManifold_ShouldThrowException()
        {
            var vertices = new[] { new Point3D(0, 0, 0), new Point3D(1, 0, 0), new Point3D(1, 1, 0), new Point3D(0, 1, 0) };
            var mesh     = new HalfEdgeMesh(vertices);

            mesh.AddFace(0, 1, 2);
            mesh.AddFace(0, 1, 2);
        }
Пример #3
0
 public void AddFace_Quad()
 {
     var vertices = new[] { new Point3D(0, 0, 0), new Point3D(1, 0, 0), new Point3D(1, 1, 0), new Point3D(0, 1, 0) };
     var mesh = new HalfEdgeMesh(vertices);
     mesh.AddFace(0, 1, 2, 3);
     Assert.AreEqual(1, mesh.Faces.Count);
     Assert.AreEqual(4, mesh.Edges.Count);
     Assert.AreEqual(4, mesh.Vertices.Count);
 }
Пример #4
0
        public void AddFace_Quad()
        {
            var vertices = new[] { new Point3D(0, 0, 0), new Point3D(1, 0, 0), new Point3D(1, 1, 0), new Point3D(0, 1, 0) };
            var mesh     = new HalfEdgeMesh(vertices);

            mesh.AddFace(0, 1, 2, 3);
            Assert.AreEqual(1, mesh.Faces.Count);
            Assert.AreEqual(4, mesh.Edges.Count);
            Assert.AreEqual(4, mesh.Vertices.Count);
        }
Пример #5
0
        private HalfEdgeMesh CreateUnitCubeMesh()
        {
            var vertices = new[]
            {
                new Point3D(0, 0, 0), new Point3D(1, 0, 0), new Point3D(1, 1, 0), new Point3D(0, 1, 0),
                new Point3D(0, 0, 1), new Point3D(1, 0, 1), new Point3D(1, 1, 1), new Point3D(0, 1, 1)
            };
            var mesh = new HalfEdgeMesh(vertices);

            mesh.AddFace(3, 2, 1, 0);
            mesh.AddFace(4, 5, 6, 7);
            mesh.AddFace(0, 1, 5, 4);
            mesh.AddFace(1, 2, 6, 5);
            mesh.AddFace(2, 3, 7, 6);
            mesh.AddFace(3, 0, 4, 7);
            return(mesh);
        }
Пример #6
0
 private static HalfEdgeMesh CreateUnitCube()
 {
     var vertices = new[]
         {
             new Point3D(0, 0, 0), new Point3D(1, 0, 0), new Point3D(1, 1, 0), new Point3D(0, 1, 0),
             new Point3D(0, 0, 1), new Point3D(1, 0, 1), new Point3D(1, 1, 1), new Point3D(0, 1, 1)
         };
     var mesh = new HalfEdgeMesh(vertices);
     mesh.AddFace(3, 2, 1, 0);
     mesh.AddFace(4, 5, 6, 7);
     mesh.AddFace(0, 1, 5, 4);
     mesh.AddFace(1, 2, 6, 5);
     mesh.AddFace(2, 3, 7, 6);
     mesh.AddFace(3, 0, 4, 7);
     return mesh;
 }