outer_facet.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 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_OUTER_FACET_H
  9. #define IGL_OUTER_FACET_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. // Compute a single facet which is guaranteed to be part of the "outer hull of
  15. // a mesh (V,F). This implementation follows Section 3.6 of "Direct repair of
  16. // self-intersecting meshes" [Attene 2014].
  17. //
  18. // Inputs:
  19. // V #V by 3 list of vertex positions
  20. // F #F by 3 list of triangle indices into V
  21. // N #F by 3 list of face normals
  22. // I #I list of facets to actually consider
  23. // Outputs:
  24. // f index of facet into V
  25. // flip whether facet's orientation should be flipped so that
  26. // counter-clockwise normal points outward.
  27. //
  28. // See also: cgal/outer_hull.h
  29. template <
  30. typename DerivedV,
  31. typename DerivedF,
  32. typename DerivedN,
  33. typename DerivedI,
  34. typename f_type>
  35. IGL_INLINE void outer_facet(
  36. const Eigen::PlainObjectBase<DerivedV> & V,
  37. const Eigen::PlainObjectBase<DerivedF> & F,
  38. const Eigen::PlainObjectBase<DerivedN> & N,
  39. const Eigen::PlainObjectBase<DerivedI> & I,
  40. f_type & f,
  41. bool & flip);
  42. }
  43. #ifndef IGL_STATIC_LIBRARY
  44. # include "outer_facet.cpp"
  45. #endif
  46. #endif