mesh_to_tetgenio.h 1.0 KB

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