PolyFEM
Loading...
Searching...
No Matches
MeshReader.hpp
Go to the documentation of this file.
1#pragma once
2
4
5#include <filesystem>
6#include <istream>
7
8namespace polyfem::mesh
9{
11 {
12 public:
13 Eigen::MatrixXd vertices;
14 Eigen::VectorXi points;
15 Eigen::MatrixXi edges;
16 Eigen::MatrixXi faces;
19 Eigen::MatrixXi tets;
20 };
21
24 {
25 public:
26 static MeshData read_msh(const std::filesystem::path &path);
27 static MeshData read_hybrid(std::istream &input, const std::string &description);
29 static MeshData read_obj(std::istream &input, const std::string &description);
30
33 static SurfaceMeshData read_msh_surface(const std::filesystem::path &path, bool keep_volume = false);
34 static SurfaceMeshData read_obj_surface(const std::filesystem::path &path);
35 static bool read_triangle_surface(const std::filesystem::path &path, SurfaceMeshData &result);
36 };
37} // namespace polyfem::mesh
Format-independent input used to construct a runtime Mesh.
Definition MeshData.hpp:12
Stateless format decoders used exclusively by MeshLoader and in-memory adapters.
static MeshData read_hybrid(std::istream &input, const std::string &description)
static MeshData read_msh(const std::filesystem::path &path)
static SurfaceMeshData read_msh_surface(const std::filesystem::path &path, bool keep_volume=false)
static bool read_triangle_surface(const std::filesystem::path &path, SurfaceMeshData &result)
static MeshData read_obj(std::istream &input, const std::string &description)
Reads a 2D polygonal mesh (planar OBJ) or a single polyhedron given by its boundary (non-planar OBJ).
static SurfaceMeshData read_obj_surface(const std::filesystem::path &path)
Eigen::MatrixXi tets
Volumetric cells indexing vertices; only filled when a 3D tet mesh is read with keep_volume.