convex_hull.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2017 Alec Jacobson <[email protected]>
  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_CONVEX_HULL_H
  9. #define IGL_COPYLEFT_CGAL_CONVEX_HULL_H
  10. #include "../../igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. namespace copyleft
  15. {
  16. namespace cgal
  17. {
  18. /// Given a set of points (V), compute the convex hull as a triangle mesh (W,G)
  19. ///
  20. /// @param[in] V #V by 3 list of input points
  21. /// @param[out] W #W by 3 list of convex hull points
  22. /// @param[out] G #G by 3 list of triangle indices into W
  23. template <
  24. typename DerivedV,
  25. typename DerivedW,
  26. typename DerivedG>
  27. IGL_INLINE void convex_hull(
  28. const Eigen::MatrixBase<DerivedV> & V,
  29. Eigen::PlainObjectBase<DerivedW> & W,
  30. Eigen::PlainObjectBase<DerivedG> & G);
  31. /// \overload
  32. template <
  33. typename DerivedV,
  34. typename DerivedF>
  35. IGL_INLINE void convex_hull(
  36. const Eigen::MatrixBase<DerivedV> & V,
  37. Eigen::PlainObjectBase<DerivedF> & F);
  38. }
  39. }
  40. }
  41. #ifndef IGL_STATIC_LIBRARY
  42. # include "convex_hull.cpp"
  43. #endif
  44. #endif