boundary_facets.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 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_BOUNDARY_FACETS_H
  9. #define IGL_BOUNDARY_FACETS_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. #include <vector>
  13. namespace igl
  14. {
  15. /// Determine boundary faces (edges) of tetrahedra (triangles) stored in T
  16. /// (analogous to qptoolbox's `outline` and `boundary_faces`).
  17. ///
  18. /// @param[in] T tetrahedron (triangle) index list, m by 4 (3), where m is the number of tetrahedra
  19. /// @param[out] F list of boundary faces, n by 3 (2), where n is the number
  20. /// of boundary faces. Faces are oriented so that igl::centroid(V,F,…)
  21. /// computes the same sign volume as igl::volume(V,T)
  22. /// @param[out] J list of indices into T, n by 1
  23. /// @param[out] K list of indices revealing across from which vertex is this facet
  24. ///
  25. template <
  26. typename DerivedT,
  27. typename DerivedF,
  28. typename DerivedJ,
  29. typename DerivedK>
  30. IGL_INLINE void boundary_facets(
  31. const Eigen::MatrixBase<DerivedT>& T,
  32. Eigen::PlainObjectBase<DerivedF>& F,
  33. Eigen::PlainObjectBase<DerivedJ>& J,
  34. Eigen::PlainObjectBase<DerivedK>& K);
  35. /// Determine boundary faces (edges) of tetrahedra (triangles) stored in T.
  36. ///
  37. /// @param[in] T tetrahedron (triangle) index list, m by 4 (3), where m is the number of tetrahedra
  38. /// @param[out] F list of boundary faces, n by 3 (2), where n is the number of boundary faces
  39. template <typename DerivedT, typename DerivedF>
  40. IGL_INLINE void boundary_facets(
  41. const Eigen::MatrixBase<DerivedT>& T,
  42. Eigen::PlainObjectBase<DerivedF>& F);
  43. /// Determine boundary faces (edges) of tetrahedra (triangles) stored in T.
  44. ///
  45. /// @param[in] T tetrahedron (triangle) index list, m by 4 (3), where m is the number of tetrahedra
  46. /// @return list of boundary faces, n by 3 (2), where n is the number of boundary faces
  47. template <typename DerivedT, typename Ret>
  48. Ret boundary_facets(
  49. const Eigen::MatrixBase<DerivedT>& T);
  50. }
  51. #ifndef IGL_STATIC_LIBRARY
  52. # include "boundary_facets.cpp"
  53. #endif
  54. #endif