simplify_polyhedron.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 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. #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. This
  16. // _would_ also make sense for open and non-manifold meshes, but the current
  17. // implementation only works with closed manifold surfaces with well defined
  18. // triangle normals.
  19. //
  20. // Inputs:
  21. // OV #OV by 3 list of input mesh vertex positions
  22. // OF #OF by 3 list of input mesh triangle indices into OV
  23. // Outputs:
  24. // V #V by 3 list of output mesh vertex positions
  25. // F #F by 3 list of input mesh triangle indices into V
  26. // J #F list of indices into OF of birth parents
  27. IGL_INLINE void simplify_polyhedron(
  28. const Eigen::MatrixXd & OV,
  29. const Eigen::MatrixXi & OF,
  30. Eigen::MatrixXd & V,
  31. Eigen::MatrixXi & F,
  32. Eigen::VectorXi & J);
  33. }
  34. #ifndef IGL_STATIC_LIBRARY
  35. # include "simplify_polyhedron.cpp"
  36. #endif
  37. #endif