示例#1
0
 public static Vector3i ToVec3i(this Rhino.Geometry.MeshFace rhMeshFace)
 {
     if (rhMeshFace.IsTriangle)
     {
         return(new Vector3i(rhMeshFace.A, rhMeshFace.B, rhMeshFace.C));
     }
     else
     {
         throw new Exception("The mesh face needs to be a triangle.");
     }
 }
示例#2
0
        private bool HandleTriangleStripMode(Rhino.Geometry.Mesh rhinoMesh)
        {
            for (int i = 0; i < rhinoMesh.Vertices.Count - 2; i++)
            {
                Rhino.Geometry.MeshFace face = new Rhino.Geometry.MeshFace(i, i + 1, i + 2);

                rhinoMesh.Faces.AddFace(face);
            }

            return(true);
        }
示例#3
0
        private bool HandleTriangleFanMode(Rhino.Geometry.Mesh rhinoMesh)
        {
            for (int i = 1; i < rhinoMesh.Vertices.Count - 1; i++)
            {
                Rhino.Geometry.MeshFace face = new Rhino.Geometry.MeshFace(0, i, i + 1);

                rhinoMesh.Faces.AddFace(face);
            }

            return(true);
        }
示例#4
0
        private bool HandleTrianglesMode(Rhino.Geometry.Mesh rhinoMesh)
        {
            int count = rhinoMesh.Vertices.Count / 3;

            for (int i = 0; i < count; i++)
            {
                int index = i * 3;

                Rhino.Geometry.MeshFace face = new Rhino.Geometry.MeshFace(index, index + 1, index + 2);

                rhinoMesh.Faces.AddFace(face);
            }

            return(true);
        }