mesh_to_polyhedron.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Alec Jacobson <[email protected]>
  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_COPYLEFT_CGAL_MESH_TO_POLYHEDRON_H
  9. #define IGL_COPYLEFT_CGAL_MESH_TO_POLYHEDRON_H
  10. #include "../../igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. namespace copyleft
  15. {
  16. namespace cgal
  17. {
  18. /// Convert a mesh (V,F) to a CGAL Polyhedron
  19. ///
  20. /// @tparam Polyhedron CGAL Polyhedron type (e.g. Polyhedron_3)
  21. /// @param[in] V #V by 3 list of vertex positions
  22. /// @param[in] F #F by 3 list of triangle indices
  23. /// @param[out] poly cgal polyhedron
  24. /// @return true only if (V,F) can be converted to a valid polyhedron
  25. /// (i.e. if (V,F) is vertex and edge manifold).
  26. template <
  27. typename DerivedV,
  28. typename DerivedF,
  29. typename Polyhedron>
  30. IGL_INLINE bool mesh_to_polyhedron(
  31. const Eigen::MatrixBase<DerivedV> & V,
  32. const Eigen::MatrixBase<DerivedF> & F,
  33. Polyhedron & poly);
  34. }
  35. }
  36. }
  37. #ifndef IGL_STATIC_LIBRARY
  38. # include "mesh_to_polyhedron.cpp"
  39. #endif
  40. #endif