add_barycenter.h 839 B

12345678910111213141516171819202122232425262728293031
  1. #ifndef IGL_DUAL_MESH_LIST_H
  2. #define IGL_DUAL_MESH_LIST_H
  3. #include "igl_inline.h"
  4. #include <Eigen/Dense>
  5. namespace igl
  6. {
  7. // Refine the mesh by adding the barycenter of each face
  8. // Inputs:
  9. // V #V by 3 coordinates of the vertices
  10. // F #F by 3 list of mesh faces (must be triangles)
  11. // Outputs:
  12. // VD #V + #F by 3 coordinate of the vertices of the dual mesh
  13. // The added vertices are added at the end of VD
  14. // FD #F*3 by 3 faces of the dual mesh
  15. //
  16. template <typename Scalar, typename Index>
  17. IGL_INLINE void add_barycenter(
  18. const Eigen::PlainObjectBase<Scalar> & V,
  19. const Eigen::PlainObjectBase<Index> & F,
  20. Eigen::PlainObjectBase<Scalar> & VD,
  21. Eigen::PlainObjectBase<Index> & FD);
  22. }
  23. #ifdef IGL_HEADER_ONLY
  24. # include "add_barycenter.cpp"
  25. #endif
  26. #endif