read_into_tetgenio.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_TETGEN_READ_INTO_TETGENIO_H
  9. #define IGL_TETGEN_READ_INTO_TETGENIO_H
  10. #include "../igl_inline.h"
  11. #include <string>
  12. #define TETLIBRARY
  13. #include "tetgen.h" // Defined tetgenio, REAL
  14. namespace igl
  15. {
  16. namespace tetgen
  17. {
  18. // Read a mesh or point set into tetgenio (input object for calling tetgen).
  19. // Many file formats are already supported by tetgen:
  20. // .off
  21. // .ply
  22. // .node
  23. // .ply
  24. // .medit
  25. // .vtk
  26. // etc.
  27. // Noteably it does not support .obj which is loaded by hand here (also
  28. // demonstrating how to load points/faces programatically)
  29. //
  30. // If the file extension is not recognized the filename is assumed to be the
  31. // basename of a collection describe a tetmesh, (of which at least the .node
  32. // file must exist):
  33. // [filename].node
  34. // [filename].ele
  35. // [filename].face
  36. // [filename].edge
  37. // [filename].vol
  38. //
  39. // Inputs:
  40. // path path to file or basename to files
  41. // Outputs:
  42. // in tetgenio input object
  43. // Returns true on success, false on error
  44. IGL_INLINE bool read_into_tetgenio(const std::string & path, tetgenio & in);
  45. }
  46. }
  47. #ifndef IGL_STATIC_LIBRARY
  48. # include "read_into_tetgenio.cpp"
  49. #endif
  50. #endif