write_triangle_mesh.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2016 Alec Jacobson <[email protected]>
  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_XML_WRITE_TRIANGLE_MESH_H
  9. #define IGL_XML_WRITE_TRIANGLE_MESH_H
  10. #include "../igl_inline.h"
  11. #include "../FileEncoding.h"
  12. #include <Eigen/Core>
  13. #include <string>
  14. namespace igl
  15. {
  16. namespace xml
  17. {
  18. /// write mesh to a file with automatic detection of file format. supported:
  19. /// dae, or any of the formats supported by igl::write_triangle_mesh
  20. ///
  21. /// @tparam Scalar type for positions and vectors (will be read as double and cast
  22. /// to Scalar)
  23. /// @tparam Index type for indices (will be read as int and cast to Index)
  24. /// @param[in] str path to file
  25. /// @param[in] V eigen double matrix #V by 3
  26. /// @param[in] F eigen int matrix #F by 3
  27. /// @return true iff success
  28. template <typename DerivedV, typename DerivedF>
  29. IGL_INLINE bool write_triangle_mesh(
  30. const std::string str,
  31. const Eigen::MatrixBase<DerivedV>& V,
  32. const Eigen::MatrixBase<DerivedF>& F,
  33. const FileEncoding fe = FileEncoding::Ascii);
  34. }
  35. }
  36. #ifndef IGL_STATIC_LIBRARY
  37. # include "write_triangle_mesh.cpp"
  38. #endif
  39. #endif