#include "writeMESH.h" #include #include "verbose.h" #include "matrix_to_list.h" #include template IGL_INLINE bool igl::writeMESH( const std::string mesh_file_name, const std::vector > & V, const std::vector > & T, const std::vector > & F) { Eigen::MatrixXd mV; Eigen::MatrixXi mT,mF; bool is_rect; is_rect = list_to_matrix(V,mV); if(!is_rect) { return false; } is_rect = list_to_matrix(T,mT); if(!is_rect) { return false; } is_rect = list_to_matrix(F,mF); if(!is_rect) { return false; } return igl::writeMESH(mesh_file_name,mV,mT,mF); } template IGL_INLINE bool igl::writeMESH( const std::string str, const Eigen::MatrixBase & V, const Eigen::MatrixBase & T, const Eigen::MatrixBase & 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, Eigen::Matrix, Eigen::Matrix >(std::basic_string, std::allocator >, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&, Eigen::MatrixBase > const&); #endif