public static Rhino.Geometry.Mesh ToRhMesh(this MeshMaker.Mesh mesh) { Rhino.Geometry.Mesh output = new Rhino.Geometry.Mesh(); foreach (Vertex pt in mesh.Vertices) { output.Vertices.Add(pt.ToRhPoint()); } foreach (MeshMaker.Color clr in mesh.Colors) { output.VertexColors.Add(clr.ToDwgColor()); } foreach (MeshMaker.Face face in mesh.Faces) { output.Faces.AddFace(face.ToRhFace()); } return(output); }
public static MeshMaker.Mesh ToCustomMesh(this Rhino.Geometry.Mesh mesh) { MeshMaker.Mesh output = new MeshMaker.Mesh(); foreach (Point3d pt in mesh.Vertices) { output.Vertices.Add(pt.ToCustomVertex()); } foreach (System.Drawing.Color clr in mesh.VertexColors) { output.Colors.Add(clr.ToCustomColor()); } foreach (MeshFace face in mesh.Faces) { output.Faces.Add(face.ToCustomFace()); } return(output); }