barycenter.h 726 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef IGL_BARYCENTER_H
  2. #define IGL_BARYCENTER_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Dense>
  5. namespace igl
  6. {
  7. // BARYCENTER
  8. //
  9. // B = barycenter(V,F)
  10. //
  11. // Compute the barycenter of every triangle
  12. //
  13. // Inputs:
  14. // V #V x dim matrix of vertex coordinates
  15. // F #F x simplex_size matrix of indices of triangle corners
  16. // Output:
  17. // BC a #F x dim matrix of 3d vertices
  18. template <
  19. typename DerivedV,
  20. typename DerivedF,
  21. typename DerivedBC>
  22. IGL_INLINE void barycenter(
  23. const Eigen::PlainObjectBase<DerivedV> & V,
  24. const Eigen::PlainObjectBase<DerivedF> & F,
  25. Eigen::PlainObjectBase<DerivedBC> & BC);
  26. }
  27. #ifdef IGL_HEADER_ONLY
  28. # include "barycenter.cpp"
  29. #endif
  30. #endif