lexicographic_triangulation.cpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2022 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. #include "lexicographic_triangulation.h"
  9. #include "../lexicographic_triangulation.h"
  10. #include "predicates.h"
  11. #include "orient2d.h"
  12. template<
  13. typename DerivedV,
  14. typename DerivedF
  15. >
  16. IGL_INLINE void igl::predicates::lexicographic_triangulation(
  17. const Eigen::MatrixBase<DerivedV>& V,
  18. Eigen::PlainObjectBase<DerivedF>& F)
  19. {
  20. const auto orient2d =
  21. [](const double *pa, const double *pb, const double *pc)
  22. {
  23. Eigen::Vector2d pav; pav << pa[0], pa[1];
  24. Eigen::Vector2d pbv; pbv << pb[0], pb[1];
  25. Eigen::Vector2d pcv; pcv << pc[0], pc[1];
  26. return int(igl::predicates::orient2d(pav, pbv, pcv));
  27. };
  28. igl::lexicographic_triangulation(V, orient2d, F);
  29. }
  30. #ifdef STATIC_LIBRARY
  31. template igl::predicates::lexicographic_triangulation<Eigen::MatrixXd,Eigen::MatrixXi>(const Eigen::MatrixXd &, Eigen::MatrixXi &);
  32. #endif