connect_boundary_to_infinity.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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_CONNECT_BOUNDARY_TO_INFINITY_H
  9. #define IGL_CONNECT_BOUNDARY_TO_INFINITY_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. /// Connect all boundary edges to a fictitious point at infinity.
  15. ///
  16. /// @param[in] F #F by 3 list of face indices into some V
  17. /// @param[out] FO #F+#O by 3 list of face indices into [V;inf inf inf], original F are
  18. /// guaranteed to come first. If (V,F) was a manifold mesh, now it is
  19. /// closed with a possibly non-manifold vertex at infinity (but it will be
  20. /// edge-manifold).
  21. template <typename DerivedF, typename DerivedFO>
  22. IGL_INLINE void connect_boundary_to_infinity(
  23. const Eigen::MatrixBase<DerivedF> & F,
  24. Eigen::PlainObjectBase<DerivedFO> & FO);
  25. /// Connect all boundary edges to a fictitious point at infinity.
  26. ///
  27. /// @param[in] F #F by 3 list of face indices into some V
  28. /// @param[in] inf_index index of point at infinity (usually V.rows() or F.maxCoeff())
  29. /// @param[out] FO #F+#O by 3 list of face indices into [V;inf inf inf], original F are
  30. /// guaranteed to come first. If (V,F) was a manifold mesh, now it is
  31. /// closed with a possibly non-manifold vertex at infinity (but it will be
  32. /// edge-manifold).
  33. template <typename DerivedF, typename DerivedFO>
  34. IGL_INLINE void connect_boundary_to_infinity(
  35. const Eigen::MatrixBase<DerivedF> & F,
  36. const typename DerivedF::Scalar inf_index,
  37. Eigen::PlainObjectBase<DerivedFO> & FO);
  38. /// Connect all boundary edges to a fictitious point at infinity.
  39. ///
  40. /// @param[in] V #V by 3 list of vertex positions
  41. /// @param[in] F #F by 3 list of face indices into some V
  42. /// @param[out] VO #V+1 by 3 list of vertex positions, original V are guaranteed to
  43. /// come first. Last point is inf, inf, inf
  44. /// @param[out] FO #F+#O by 3 list of face indices into VO
  45. ///
  46. template <
  47. typename DerivedV,
  48. typename DerivedF,
  49. typename DerivedVO,
  50. typename DerivedFO>
  51. IGL_INLINE void connect_boundary_to_infinity(
  52. const Eigen::MatrixBase<DerivedV> & V,
  53. const Eigen::MatrixBase<DerivedF> & F,
  54. Eigen::PlainObjectBase<DerivedVO> & VO,
  55. Eigen::PlainObjectBase<DerivedFO> & FO);
  56. }
  57. #ifndef IGL_STATIC_LIBRARY
  58. # include "connect_boundary_to_infinity.cpp"
  59. #endif
  60. #endif