triangulate.h 787 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef IGL_TRIANGULATE_H
  2. #define IGL_TRIANGULATE_H
  3. #include "igl_inline.h"
  4. #ifndef IGL_NO_EIGEN
  5. # include <Eigen/Core>
  6. #endif
  7. #include <vector>
  8. namespace igl
  9. {
  10. // Triangulate a general polygonal mesh into a triangle mesh.
  11. //
  12. // Inputs:
  13. // vF list of polygon index lists
  14. // Outputs:
  15. // F eigen int matrix #F by 3
  16. //
  17. // Example:
  18. // vector<vector<double > > vV;
  19. // vector<vector<int > > vF;
  20. // read("poly.obj",vV,vF);
  21. // MatrixXd V;
  22. // MatrixXi F;
  23. // list_to_matrix(vV,V);
  24. // triangulate(vF,F);
  25. template <typename Index, typename DerivedF>
  26. IGL_INLINE void triangulate(
  27. const std::vector<std::vector<Index> > & vF,
  28. Eigen::PlainObjectBase<DerivedF>& F);
  29. }
  30. #ifdef IGL_HEADER_ONLY
  31. # include "triangulate.cpp"
  32. #endif
  33. #endif