mesh_to_polyhedron.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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_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. // Templates:
  21. // Polyhedron CGAL Polyhedron type (e.g. Polyhedron_3)
  22. // Inputs:
  23. // V #V by 3 list of vertex positions
  24. // F #F by 3 list of triangle indices
  25. // Outputs:
  26. // poly cgal polyhedron
  27. // Returns true only if (V,F) can be converted to a valid polyhedron (i.e. if
  28. // (V,F) is vertex and edge manifold).
  29. template <typename Polyhedron>
  30. IGL_INLINE bool mesh_to_polyhedron(
  31. const Eigen::MatrixXd & V,
  32. const Eigen::MatrixXi & F,
  33. Polyhedron & poly);
  34. }
  35. }
  36. }
  37. #ifndef IGL_STATIC_LIBRARY
  38. # include "mesh_to_polyhedron.cpp"
  39. #endif
  40. #endif