convex_hull.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2017 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_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. // Inputs:
  21. // V #V by 3 list of input points
  22. // Outputs:
  23. // W #W by 3 list of convex hull points
  24. // G #G by 3 list of triangle indices into W
  25. template <
  26. typename DerivedV,
  27. typename DerivedW,
  28. typename DerivedG>
  29. IGL_INLINE void convex_hull(
  30. const Eigen::MatrixBase<DerivedV> & V,
  31. Eigen::PlainObjectBase<DerivedW> & W,
  32. Eigen::PlainObjectBase<DerivedG> & G);
  33. // Given a set of points (V), compute the convex hull as a triangle mesh (F)
  34. // over input vertex set (V)
  35. //
  36. // Inputs:
  37. // V #V by 3 list of input points
  38. // Outputs:
  39. // F #F by 3 list of triangle indices into V
  40. //
  41. template <
  42. typename DerivedV,
  43. typename DerivedF>
  44. IGL_INLINE void convex_hull(
  45. const Eigen::MatrixBase<DerivedV> & V,
  46. Eigen::PlainObjectBase<DerivedF> & F);
  47. }
  48. }
  49. }
  50. #ifndef IGL_STATIC_LIBRARY
  51. # include "convex_hull.cpp"
  52. #endif
  53. #endif