mesh_to_tetgenio.h 1.4 KB

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