tetgenio_to_tetmesh.h 1.0 KB

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