boundary_facets.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 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_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. // BOUNDARY_FACETS Determine boundary faces (edges) of tetrahedra (triangles)
  16. // stored in T (analogous to qptoolbox's `outline` and `boundary_faces`).
  17. //
  18. // Input:
  19. // T tetrahedron (triangle) index list, m by 4 (3), where m is the number of tetrahedra
  20. // Output:
  21. // F list of boundary faces, n by 3 (2), where n is the number of boundary faces
  22. // J list of indices into T, n by 1
  23. // K list of indices revealing across from which vertex is this facet
  24. //
  25. //
  26. template <
  27. typename DerivedT,
  28. typename DerivedF,
  29. typename DerivedJ,
  30. typename DerivedK>
  31. IGL_INLINE void boundary_facets(
  32. const Eigen::MatrixBase<DerivedT>& T,
  33. Eigen::PlainObjectBase<DerivedF>& F,
  34. Eigen::PlainObjectBase<DerivedJ>& J,
  35. Eigen::PlainObjectBase<DerivedK>& K);
  36. template <typename DerivedT, typename DerivedF>
  37. IGL_INLINE void boundary_facets(
  38. const Eigen::MatrixBase<DerivedT>& T,
  39. Eigen::PlainObjectBase<DerivedF>& F);
  40. // Same as above but returns F
  41. template <typename DerivedT, typename Ret>
  42. Ret boundary_facets(
  43. const Eigen::MatrixBase<DerivedT>& T);
  44. template <typename IntegerT, typename IntegerF>
  45. IGL_INLINE void boundary_facets(
  46. const std::vector<std::vector<IntegerT> > & T,
  47. std::vector<std::vector<IntegerF> > & F);
  48. }
  49. #ifndef IGL_STATIC_LIBRARY
  50. # include "boundary_facets.cpp"
  51. #endif
  52. #endif