writeOBJ.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2013 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_WRITEOBJ_H
  9. #define IGL_WRITEOBJ_H
  10. #include "igl_inline.h"
  11. // History:
  12. // return type changed from void to bool Alec 20 Sept 2011
  13. #include <Eigen/Core>
  14. #include <string>
  15. namespace igl
  16. {
  17. // Write a mesh in an ascii obj file
  18. // Inputs:
  19. // str path to outputfile
  20. // V eigen double matrix #V by 3 (mesh vertices)
  21. // F eigen int matrix #F by 3 (mesh indices)
  22. // Returns true on success, false on error
  23. template <typename DerivedV, typename DerivedF>
  24. IGL_INLINE bool writeOBJ(
  25. const std::string str,
  26. const Eigen::PlainObjectBase<DerivedV>& V,
  27. const Eigen::PlainObjectBase<DerivedF>& F);
  28. template <typename DerivedV, typename DerivedF, typename DerivedT>
  29. IGL_INLINE bool writeOBJ(
  30. const std::string str,
  31. const Eigen::PlainObjectBase<DerivedV>& V,
  32. const Eigen::PlainObjectBase<DerivedF>& F,
  33. const Eigen::PlainObjectBase<DerivedV>& CN,
  34. const Eigen::PlainObjectBase<DerivedF>& FN,
  35. const Eigen::PlainObjectBase<DerivedT>& TC,
  36. const Eigen::PlainObjectBase<DerivedF>& FTC);
  37. }
  38. #ifdef IGL_HEADER_ONLY
  39. # include "writeOBJ.cpp"
  40. #endif
  41. #endif