example.cpp 603 B

1234567891011121314151617181920212223242526272829303132
  1. #include <Eigen/Core>
  2. #include <igl/readDMAT.h>
  3. #include <cstdio>
  4. #ifndef IGL_HEADER_ONLY
  5. # define IGL_HEADER_ONLY
  6. # define IGL_HEADER_ONLY_WAS_NOT_DEFINED
  7. #endif
  8. #include <igl/MatlabWorkspace.h>
  9. #include <igl/on_boundary.h>
  10. #ifdef IGL_HEADER_ONLY_WAS_NOT_DEFINED
  11. # undef IGL_HEADER_ONLY
  12. #endif
  13. int main(int argc, char * argv[])
  14. {
  15. using namespace igl;
  16. using namespace Eigen;
  17. if(argc <= 2)
  18. {
  19. printf("USAGE:\n ./example [input path] [output path]\n");
  20. return 1;
  21. }
  22. MatrixXd M;
  23. readDMAT(argv[1],M);
  24. MatlabWorkspace mat;
  25. mat.save(M,"M");
  26. mat.write(argv[2]);
  27. return 0;
  28. }