read_into_tetgenio.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef IGL_READ_INTO_TETGENIO_H
  2. #define IGL_READ_INTO_TETGENIO_H
  3. #include "../igl_inline.h"
  4. #include <string>
  5. #define TETLIBRARY
  6. #include "tetgen.h" // Defined tetgenio, REAL
  7. namespace igl
  8. {
  9. // Read a mesh or point set into tetgenio (input object for calling tetgen).
  10. // Many file formats are already supported by tetgen:
  11. // .off
  12. // .ply
  13. // .node
  14. // .ply
  15. // .medit
  16. // .vtk
  17. // etc.
  18. // Noteably it does not support .obj which is loaded by hand here (also
  19. // demonstrating how to load points/faces programatically)
  20. //
  21. // If the file extension is not recognized the filename is assumed to be the
  22. // basename of a collection describe a tetmesh, (of which at least the .node
  23. // file must exist):
  24. // [filename].node
  25. // [filename].ele
  26. // [filename].face
  27. // [filename].edge
  28. // [filename].vol
  29. //
  30. // Inputs:
  31. // path path to file or basename to files
  32. // Outputs:
  33. // in tetgenio input object
  34. // Returns true on success, false on error
  35. IGL_INLINE bool read_into_tetgenio(const std::string & path, tetgenio & in);
  36. }
  37. #ifdef IGL_HEADER_ONLY
  38. # include "read_into_tetgenio.cpp"
  39. #endif
  40. #endif