readMSH.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2018 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_READMSH_H
  9. #define IGL_READMSH_H
  10. #include "igl_inline.h"
  11. #include <Eigen/Dense>
  12. #include <string>
  13. namespace igl
  14. {
  15. // Read a mesh (e.g., tet mesh) from a gmsh .msh file
  16. //
  17. // Inputs:
  18. // filename path to .msh file
  19. // Outputs:
  20. // V #V by 3 list of 3D mesh vertex positions
  21. // T #T by ss list of 3D ss-element indices into V (e.g., ss=4 for tets)
  22. // Returns true on success
  23. template <
  24. typename DerivedV,
  25. typename DerivedT>
  26. IGL_INLINE bool readMSH(
  27. const std::string & filename,
  28. Eigen::PlainObjectBase<DerivedV> & V,
  29. Eigen::PlainObjectBase<DerivedT> & T);
  30. }
  31. #ifndef IGL_STATIC_LIBRARY
  32. # include "readMSH.cpp"
  33. #endif
  34. #endif