simplify_polyhedron.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 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. #ifndef IGL_SIMPLIFY_POLYHEDRON_H
  9. #define IGL_SIMPLIFY_POLYHEDRON_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. /// Simplify a polyhedron represented as a triangle mesh (OV,OF) by collapsing
  15. /// any edge that doesn't contribute to defining surface's pointset.
  16. ///
  17. /// \pre This _would_ also make sense for open and non-manifold meshes, but
  18. /// the current implementation only works with closed manifold surfaces with
  19. /// well defined triangle normals.
  20. ///
  21. /// @param[in] OV #OV by 3 list of input mesh vertex positions
  22. /// @param[in] OF #OF by 3 list of input mesh triangle indices into OV
  23. /// @param[out] V #V by 3 list of output mesh vertex positions
  24. /// @param[out] F #F by 3 list of input mesh triangle indices into V
  25. /// @param[out] J #F list of indices into OF of birth parents
  26. IGL_INLINE void simplify_polyhedron(
  27. const Eigen::MatrixXd & OV,
  28. const Eigen::MatrixXi & OF,
  29. Eigen::MatrixXd & V,
  30. Eigen::MatrixXi & F,
  31. Eigen::VectorXi & J);
  32. }
  33. #ifndef IGL_STATIC_LIBRARY
  34. # include "simplify_polyhedron.cpp"
  35. #endif
  36. #endif