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."); } }
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); }
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); }
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); }