read_into_tetgenio.h 1.1 KB

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