progressive_hulls.cpp 1.1 KB

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