#include "writeMESH.h" #include #include "verbose.h" template IGL_INLINE bool igl::writeMESH( const std::string mesh_file_name, std::vector > & V, std::vector > & T, std::vector > & F) { // not implemented but should be assert(false); return false; } #include IGL_INLINE bool igl::writeMESH( const std::string str, Eigen::MatrixXd& V, Eigen::MatrixXi& T, Eigen::MatrixXi& F) { using namespace std; using namespace igl; using namespace Eigen; FILE * mesh_file = fopen(str.c_str(),"w"); if(NULL==mesh_file) { fprintf(stderr,"IOError: %s could not be opened...",str.c_str()); return false; } // print header fprintf(mesh_file,"MeshVersionFormatted 1\n"); fprintf(mesh_file,"Dimension 3\n"); // print tet vertices fprintf(mesh_file,"Vertices\n"); // print number of tet vertices int number_of_tet_vertices = V.rows(); fprintf(mesh_file,"%d\n",number_of_tet_vertices); // loop over tet vertices for(int i = 0;i