writeOBJ.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //
  2. // IGL Lib - Simple C++ mesh library
  3. //
  4. // Copyright 2011, Daniele Panozzo. All rights reserved.
  5. // History:
  6. // return type changed from void to bool Alec 20 Sept 2011
  7. #ifndef IGL_WRITEOBJ_H
  8. #define IGL_WRITEOBJ_H
  9. #include "igl_inline.h"
  10. #include <Eigen/Core>
  11. #include <string>
  12. namespace igl
  13. {
  14. // Write a mesh in an ascii obj file
  15. // Inputs:
  16. // str path to outputfile
  17. // V eigen double matrix #V by 3 (mesh vertices)
  18. // F eigen int matrix #F by 3 (mesh indices)
  19. // Returns true on success, false on error
  20. template <typename DerivedV, typename DerivedF>
  21. IGL_INLINE bool writeOBJ(
  22. const std::string str,
  23. const Eigen::PlainObjectBase<DerivedV>& V,
  24. const Eigen::PlainObjectBase<DerivedF>& F);
  25. template <typename DerivedV, typename DerivedF, typename DerivedT>
  26. IGL_INLINE bool writeOBJ(
  27. const std::string str,
  28. const Eigen::PlainObjectBase<DerivedV>& V,
  29. const Eigen::PlainObjectBase<DerivedF>& F,
  30. const Eigen::PlainObjectBase<DerivedV>& CN,
  31. const Eigen::PlainObjectBase<DerivedF>& FN,
  32. const Eigen::PlainObjectBase<DerivedT>& TC,
  33. const Eigen::PlainObjectBase<DerivedF>& FTC);
  34. }
  35. #ifdef IGL_HEADER_ONLY
  36. # include "writeOBJ.cpp"
  37. #endif
  38. #endif