progressive_hulls.cpp 901 B

12345678910111213141516171819202122232425262728293031
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 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. #include "progressive_hulls.h"
  9. #include "progressive_hulls_cost_and_placement.h"
  10. #include "../decimate.h"
  11. #include "../max_faces_stopping_condition.h"
  12. IGL_INLINE bool igl::copyleft::progressive_hulls(
  13. const Eigen::MatrixXd & V,
  14. const Eigen::MatrixXi & F,
  15. const size_t max_m,
  16. Eigen::MatrixXd & U,
  17. Eigen::MatrixXi & G,
  18. Eigen::VectorXi & J)
  19. {
  20. int m = F.rows();
  21. Eigen::VectorXi I;
  22. return decimate(
  23. V,
  24. F,
  25. progressive_hulls_cost_and_placement,
  26. max_faces_stopping_condition(m,(const int)m,max_m),
  27. U,
  28. G,
  29. J,
  30. I);
  31. }