upsample.h 970 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef IGL_UPSAMPLE_H
  2. #define IGL_UPSAMPLE_H
  3. #include "igl_inline.h"
  4. namespace igl
  5. {
  6. // Subdivide a mesh without moving vertices: loop subdivision but odd
  7. // vertices stay put and even vertices are just edge midpoints
  8. //
  9. // Templates:
  10. // MatV matrix for vertex positions, e.g. MatrixXd
  11. // MatF matrix for vertex positions, e.g. MatrixXi
  12. // Inputs:
  13. // V #V by dim mesh vertices
  14. // F #F by 3 mesh triangles
  15. // Outputs:
  16. // NV new vertex positions, V is guaranteed to be at top
  17. // NF new list of face indices
  18. //
  19. // NOTE: V should not be the same as NV,
  20. // NOTE: F should not be the same as NF, use other proto
  21. template <typename MatV, typename MatF>
  22. IGL_INLINE void upsample( const MatV & V, const MatF & F, MatV & NV, MatF & NF);
  23. // Virtually in place wrapper
  24. template <typename MatV, typename MatF>
  25. IGL_INLINE void upsample( MatV & V,MatF & F);
  26. }
  27. #ifdef IGL_HEADER_ONLY
  28. # include "upsample.cpp"
  29. #endif
  30. #endif