box_surface_area.h 892 B

123456789101112131415161718192021222324252627282930
  1. #ifndef IGL_BOX_SURFACE_AREA_H
  2. #define IGL_BOX_SURFACE_AREA_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Core>
  5. #include <Eigen/Geometry>
  6. namespace igl
  7. {
  8. /// Compute the surface area of a box given its min and max corners
  9. ///
  10. /// @param[in] min_corner #d vector of min corner position
  11. /// @param[in] max_corner #d vector of max corner position
  12. /// @return surface area of box
  13. template <typename DerivedCorner>
  14. IGL_INLINE typename DerivedCorner::Scalar box_surface_area(
  15. const Eigen::MatrixBase<DerivedCorner> & min_corner,
  16. const Eigen::MatrixBase<DerivedCorner> & max_corner);
  17. /// \overload
  18. /// @param[in] box axis-aligned bounding box
  19. template <typename Scalar, int AmbientDim>
  20. IGL_INLINE Scalar box_surface_area(
  21. const Eigen::AlignedBox<Scalar,AmbientDim> & box);
  22. }
  23. #ifndef IGL_STATIC_LIBRARY
  24. # include "box_surface_area.cpp"
  25. #endif
  26. #endif