eytzinger_aabb.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2025 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_EYTZINGER_AABB_H
  9. #define IGL_EYTZINGER_AABB_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. /// Compute the Eytzinger AABB for a given mesh
  15. ///
  16. /// @param[in] PB1 #P by dim list of minimum corners of the AABBs
  17. /// @param[in] PB2 #P by dim list of maximum corners of the AABBs
  18. /// @param[out] B1 #B by dim list of minimum corners of the Eytzinger AABBs
  19. /// @param[out] B2 #B by dim list of maximum corners of the Eytzinger AABBs
  20. /// @param[out] leaf #B list of leaf indices, -1 indicates internal node, -2
  21. /// indicates empty node
  22. ///
  23. template <
  24. typename DerivedPB,
  25. typename DerivedB,
  26. typename Derivedleaf
  27. >
  28. IGL_INLINE void eytzinger_aabb(
  29. const Eigen::MatrixBase<DerivedPB> & PB1,
  30. const Eigen::MatrixBase<DerivedPB> & PB2,
  31. Eigen::PlainObjectBase<DerivedB> & B1,
  32. Eigen::PlainObjectBase<DerivedB> & B2,
  33. Eigen::PlainObjectBase<Derivedleaf> & leaf);
  34. }
  35. #ifndef IGL_STATIC_LIBRARY
  36. # include "eytzinger_aabb.cpp"
  37. #endif
  38. #endif