mesh_to_polyhedron.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 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_CGAL_MESH_TO_POLYHEDRON_H
  9. #define IGL_CGAL_MESH_TO_POLYHEDRON_H
  10. #include <igl/igl_inline.h>
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. namespace cgal
  15. {
  16. // Convert a mesh (V,F) to a CGAL Polyhedron
  17. //
  18. // Templates:
  19. // Polyhedron CGAL Polyhedron type (e.g. Polyhedron_3)
  20. // Inputs:
  21. // V #V by 3 list of vertex positions
  22. // F #F by 3 list of triangle indices
  23. // Outputs:
  24. // poly cgal polyhedron
  25. // Returns true only if (V,F) can be converted to a valid polyhedron (i.e. if
  26. // (V,F) is vertex and edge manifold).
  27. template <typename Polyhedron>
  28. IGL_INLINE bool mesh_to_polyhedron(
  29. const Eigen::MatrixXd & V,
  30. const Eigen::MatrixXi & F,
  31. Polyhedron & poly);
  32. }
  33. }
  34. #ifndef IGL_STATIC_LIBRARY
  35. # include "mesh_to_polyhedron.cpp"
  36. #endif
  37. #endif