$search
00001 /* 00002 James R. Diebel 00003 Stanford University 00004 00005 Started: 2 December 2004 00006 00007 msh2ply.cc - Utility to convert a MSH file to a PLY file 00008 00009 Depends on: 00010 - Mesh class (mesh.hh) 00011 -- Vec3d class (vec3d.hh) 00012 -- Vert class (vert.hh) 00013 -- Edge class (edge.hh) 00014 -- Face class (face.hh) 00015 - Timer class (timer.hh) 00016 - TriMesh class (trimesh.h) 00017 */ 00018 00019 00020 #include <iostream> 00021 #include "bmtk/mesh.hh" 00022 #include "bmtk/timer.hh" 00023 #include <trimesh/trimesh.h> 00024 #include <trimesh/trimesh_endian.h> 00025 00026 using namespace std; 00027 using namespace bmtk; 00028 00029 int main (int argc, char *argv[]) { 00030 // if bad command line args, give usage instructions and exit 00031 if (argc < 3) { 00032 cout << endl 00033 << "Usage: msh2ply infile.msh outfile.ply" << endl 00034 << " infile.msh must be an msh file" << endl 00035 << " outfile.ply is a little-endian binary ply file" << endl; 00036 exit(1); 00037 } 00038 00039 // read Mesh from file 00040 Mesh m; 00041 m.readMesh(argv[1]); 00042 00043 // Export Mesh to ply format 00044 m.exportToPLY(argv[2]); 00045 00046 return 0; 00047 }