mesh_to_polyhedron.h 1.1 KB

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