writeMESH.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef IGL_WRITEMESH_H
  2. #define IGL_WRITEMESH_H
  3. #include "igl_inline.h"
  4. #include <string>
  5. #include <vector>
  6. #include <Eigen/Core>
  7. namespace igl
  8. {
  9. // save a tetrahedral volume mesh to a .mesh file
  10. //
  11. // Templates:
  12. // Scalar type for positions and vectors (will be cast as double)
  13. // Index type for indices (will be cast to int)
  14. // Input:
  15. // mesh_file_name path of .mesh file
  16. // Outputs:
  17. // V double matrix of vertex positions #V by 3
  18. // T #T list of tet indices into vertex positions
  19. // F #F list of face indices into vertex positions
  20. template <typename Scalar, typename Index>
  21. IGL_INLINE bool writeMESH(
  22. const std::string mesh_file_name,
  23. std::vector<std::vector<Scalar > > & V,
  24. std::vector<std::vector<Index > > & T,
  25. std::vector<std::vector<Index > > & F);
  26. // Input:
  27. // mesh_file_name path of .mesh file
  28. // Outputs:
  29. // V eigen double matrix #V by 3
  30. // T eigen int matrix #T by 4
  31. // F eigen int matrix #F by 3
  32. IGL_INLINE bool writeMESH(
  33. const std::string str,
  34. Eigen::MatrixXd& V,
  35. Eigen::MatrixXi& T,
  36. Eigen::MatrixXi& F);
  37. }
  38. #ifdef IGL_HEADER_ONLY
  39. # include "writeMESH.cpp"
  40. #endif
  41. #endif