lexicographic_triangulation.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 Alec Jacobson <[email protected]>
  4. // Qingan Zhou <[email protected]>
  5. //
  6. // This Source Code Form is subject to the terms of the Mozilla Public License
  7. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  8. // obtain one at http://mozilla.org/MPL/2.0/.
  9. #ifndef IGL_LEXICOGRAPHIC_TRIANGULATION_H
  10. #define IGL_LEXICOGRAPHIC_TRIANGULATION_H
  11. #include "igl_inline.h"
  12. #include <Eigen/Core>
  13. namespace igl
  14. {
  15. /// Given a set of points in 2D, return a lexicographic triangulation of these
  16. /// points.
  17. ///
  18. /// @param[in] P #P by 2 list of vertex positions
  19. /// @param[in] orient2D A functor such that orient2D(pa, pb, pc) returns
  20. /// 1 if pa,pb,pc forms a conterclockwise triangle.
  21. /// -1 if pa,pb,pc forms a clockwise triangle.
  22. /// 0 if pa,pb,pc are collinear.
  23. /// where the argument pa,pb,pc are of type Scalar[2].
  24. /// @param[out] F #F by 3 of faces in lexicographic triangulation.
  25. template<
  26. typename DerivedP,
  27. typename Orient2D,
  28. typename DerivedF
  29. >
  30. IGL_INLINE void lexicographic_triangulation(
  31. const Eigen::MatrixBase<DerivedP>& P,
  32. Orient2D orient2D,
  33. Eigen::PlainObjectBase<DerivedF>& F);
  34. }
  35. #ifndef IGL_STATIC_LIBRARY
  36. # include "lexicographic_triangulation.cpp"
  37. #endif
  38. #endif