circumradius.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 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_CIRCUMRADIUS_H
  9. #define IGL_CIRCUMRADIUS_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Core>
  12. namespace igl
  13. {
  14. /// Compute the circumradius of each triangle in a mesh (V,F)
  15. ///
  16. /// @param[in] V #V by dim list of mesh vertex positions
  17. /// @param[in] F #F by 3 list of triangle indices into V
  18. /// @param[out] R #F list of circumradius
  19. ///
  20. template <
  21. typename DerivedV,
  22. typename DerivedF,
  23. typename DerivedR>
  24. IGL_INLINE void circumradius(
  25. const Eigen::MatrixBase<DerivedV> & V,
  26. const Eigen::MatrixBase<DerivedF> & F,
  27. Eigen::PlainObjectBase<DerivedR> & R);
  28. /// Generic version
  29. ///
  30. /// @param[in] V #V by dim list of mesh vertex positions
  31. /// @param[in] T #T by simplex-size list of simplex indices into V
  32. /// @param[out] R #T list of circumradius
  33. /// @param[out] C #T by dim list of circumcenter
  34. /// @param[out] B #T by simplex-size list of barycentric coordinates of circumcenter
  35. template <
  36. typename DerivedV,
  37. typename DerivedT,
  38. typename DerivedR,
  39. typename DerivedC,
  40. typename DerivedB>
  41. IGL_INLINE void circumradius(
  42. const Eigen::MatrixBase<DerivedV> & V,
  43. const Eigen::MatrixBase<DerivedT> & T,
  44. Eigen::PlainObjectBase<DerivedR> & R,
  45. Eigen::PlainObjectBase<DerivedC> & C,
  46. Eigen::PlainObjectBase<DerivedB> & B);
  47. }
  48. #ifndef IGL_STATIC_LIBRARY
  49. # include "circumradius.cpp"
  50. #endif
  51. #endif