complex_to_mesh.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2014 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_COMPLEX_TO_MESH_H
  9. #define IGL_COMPLEX_TO_MESH_H
  10. #include "../igl_inline.h"
  11. #include <Eigen/Dense>
  12. #include <CGAL/Complex_2_in_triangulation_3.h>
  13. namespace igl
  14. {
  15. // Templates:
  16. // Tr CGAL triangulation type, e.g.
  17. // CGAL::Surface_mesh_default_triangulation_3
  18. // Inputs
  19. // c2t3 2-complex (surface) living in a 3d triangulation (e.g. result of
  20. // CGAL::make_surface_mesh)
  21. // Outputs:
  22. // V #V by 3 list of vertex positions
  23. // F #F by 3 list of triangle indices
  24. // Returns true iff conversion was successful, failure can ok if CGAL code
  25. // can't figure out ordering.
  26. //
  27. template <typename Tr, typename DerivedV, typename DerivedF>
  28. IGL_INLINE bool complex_to_mesh(
  29. const CGAL::Complex_2_in_triangulation_3<Tr> & c2t3,
  30. Eigen::PlainObjectBase<DerivedV> & V,
  31. Eigen::PlainObjectBase<DerivedF> & F);
  32. }
  33. #ifndef IGL_STATIC_LIBRARY
  34. # include "complex_to_mesh.cpp"
  35. #endif
  36. #endif