mesh_to_polyhedron.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 <
  30. typename DerivedV,
  31. typename DerivedF,
  32. typename Polyhedron>
  33. IGL_INLINE bool mesh_to_polyhedron(
  34. const Eigen::MatrixBase<DerivedV> & V,
  35. const Eigen::MatrixBase<DerivedF> & F,
  36. Polyhedron & poly);
  37. }
  38. }
  39. }
  40. #ifndef IGL_STATIC_LIBRARY
  41. # include "mesh_to_polyhedron.cpp"
  42. #endif
  43. #endif