boundary_faces.h 1.6 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_FACES_H
  9. #define IGL_BOUNDARY_FACES_H
  10. #include "igl_inline.h"
  11. #ifndef IGL_NO_EIGEN
  12. # include <Eigen/Dense>
  13. #endif
  14. #include <vector>
  15. namespace igl
  16. {
  17. // BOUNDARY_FACES Determine boundary faces (edges) of tetrahedra (triangles)
  18. // stored in T
  19. //
  20. // Templates:
  21. // IntegerT integer-value: e.g. int
  22. // IntegerF integer-value: e.g. int
  23. // Input:
  24. // T tetrahedron (triangle) index list, m by 4 (3), where m is the number of tetrahedra
  25. // Output:
  26. // F list of boundary faces, n by 3 (2), where n is the number of boundary faces
  27. //
  28. //
  29. template <typename IntegerT, typename IntegerF>
  30. IGL_INLINE void boundary_faces(
  31. const std::vector<std::vector<IntegerT> > & T,
  32. std::vector<std::vector<IntegerF> > & F);
  33. #ifndef IGL_NO_EIGEN
  34. // Templates:
  35. // DerivedT integer-value: i.e. from MatrixXi
  36. // DerivedF integer-value: i.e. from MatrixXi
  37. template <typename DerivedT, typename DerivedF>
  38. IGL_INLINE void boundary_faces(
  39. const Eigen::PlainObjectBase<DerivedT>& T,
  40. Eigen::PlainObjectBase<DerivedF>& F);
  41. // Same as above but returns F
  42. template <typename DerivedT, typename Ret>
  43. Ret boundary_faces(
  44. const Eigen::PlainObjectBase<DerivedT>& T);
  45. #endif
  46. }
  47. #ifdef IGL_HEADER_ONLY
  48. # include "boundary_faces.cpp"
  49. #endif
  50. #endif