mesh_to_tetgenio.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef IGL_MESH_TO_TETGENIO_H
  2. #define IGL_MESH_TO_TETGENIO_H
  3. #include "../igl_inline.h"
  4. #define TETLIBRARY
  5. #include "tetgen.h" // Defined tetgenio, REAL
  6. #include <vector>
  7. #include <Eigen/Core>
  8. namespace igl
  9. {
  10. // Load a vertex list and face list into a tetgenio object
  11. // Inputs:
  12. // V #V by 3 vertex position list
  13. // F #F list of polygon face indices into V (0-indexed)
  14. // Outputs:
  15. // in tetgenio input object
  16. // Returns true on success, false on error
  17. IGL_INLINE bool mesh_to_tetgenio(
  18. const std::vector<std::vector<REAL > > & V,
  19. const std::vector<std::vector<int> > & F,
  20. tetgenio & in);
  21. // Wrapper with Eigen types
  22. // Templates:
  23. // DerivedV real-value: i.e. from MatrixXd
  24. // DerivedF integer-value: i.e. from MatrixXi
  25. template <typename DerivedV, typename DerivedF>
  26. IGL_INLINE bool mesh_to_tetgenio(
  27. const Eigen::PlainObjectBase<DerivedV>& V,
  28. const Eigen::PlainObjectBase<DerivedF>& F,
  29. tetgenio & in);
  30. }
  31. #ifdef IGL_HEADER_ONLY
  32. # include "mesh_to_tetgenio.cpp"
  33. #endif
  34. #endif