boundary_facets.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. // Templates:
  19. // IntegerT integer-value: e.g. int
  20. // IntegerF integer-value: e.g. int
  21. // Input:
  22. // T tetrahedron (triangle) index list, m by 4 (3), where m is the number of tetrahedra
  23. // Output:
  24. // F list of boundary faces, n by 3 (2), where n is the number of boundary faces
  25. //
  26. //
  27. template <typename IntegerT, typename IntegerF>
  28. IGL_INLINE void boundary_facets(
  29. const std::vector<std::vector<IntegerT> > & T,
  30. std::vector<std::vector<IntegerF> > & F);
  31. // Templates:
  32. // DerivedT integer-value: i.e. from MatrixXi
  33. // DerivedF integer-value: i.e. from MatrixXi
  34. template <typename DerivedT, typename DerivedF>
  35. IGL_INLINE void boundary_facets(
  36. const Eigen::PlainObjectBase<DerivedT>& T,
  37. Eigen::PlainObjectBase<DerivedF>& F);
  38. // Same as above but returns F
  39. template <typename DerivedT, typename Ret>
  40. Ret boundary_facets(
  41. const Eigen::PlainObjectBase<DerivedT>& T);
  42. }
  43. #ifndef IGL_STATIC_LIBRARY
  44. # include "boundary_facets.cpp"
  45. #endif
  46. #endif