PolyFEM
Loading...
Searching...
No Matches
MeshUtils.hpp File Reference
#include <polyfem/mesh/Mesh.hpp>
#include <polyfem/mesh/mesh2D/PolygonMesh.hpp>
#include <polyfem/mesh/mesh3D/Navigation3D.hpp>
#include <Eigen/Dense>
#include <vector>
#include <memory>
Include dependency graph for MeshUtils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  polyfem
 
namespace  polyfem::mesh
 

Functions

PolygonMesh::Point polyfem::mesh::mesh_vertex (const PolygonMesh &M, int v)
 Retrieve a 3D vector with the position of a given vertex.
 
PolygonMesh::Point polyfem::mesh::facet_barycenter (const PolygonMesh &M, int f)
 
int polyfem::mesh::mesh_create_vertex (PolygonMesh &M, const PolygonMesh::Point &p)
 
void polyfem::mesh::compute_element_tags (const PolygonMesh &M, std::vector< ElementType > &element_tags)
 Compute the type of each facet in a surface mesh.
 
void polyfem::mesh::orient_normals_2d (PolygonMesh &M)
 Orient facets of a 2D mesh so that each connected component has positive volume.
 
void polyfem::mesh::reorder_mesh (Eigen::MatrixXd &V, Eigen::MatrixXi &F, const Eigen::VectorXi &C, Eigen::VectorXi &R)
 Reorder vertices of a mesh using color tags, so that vertices are ordered by increasing colors.
 
void polyfem::mesh::offset_surface_vertices (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const Eigen::RowVector3d &interior_point, double distance, Eigen::MatrixXd &offset)
 Offset along area-weighted surface normals, using the direction away from an interior point where incident normals cancel.
 
void polyfem::mesh::signed_squared_distances (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const Eigen::MatrixXd &P, Eigen::VectorXd &D)
 Computes the signed squared distance from a list of points to a triangle mesh.
 
double polyfem::mesh::signed_volume (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F)
 Compute the signed volume of a surface mesh.
 
void polyfem::mesh::orient_closed_surface (const Eigen::MatrixXd &V, Eigen::MatrixXi &F, bool positive=true)
 Orient a triangulated surface to have positive volume.
 
std::vector< std::pair< Navigation::Index, Navigation::Index > > polyfem::mesh::compute_mesh_interface (const Mesh2D &first, const Mesh2D &second)
 Pair coincident boundary edges, including nonconforming leader/follower edges.
 
std::vector< std::pair< Navigation3D::Index, Navigation3D::Index > > polyfem::mesh::compute_mesh_interface (const Mesh3D &first, const Mesh3D &second)
 Pair coincident boundary faces, including nonconforming leader/follower faces.
 
void polyfem::mesh::extract_parent_edges (const Eigen::MatrixXd &IV, const Eigen::MatrixXi &IE, const Eigen::MatrixXd &BV, const Eigen::MatrixXi &BE, Eigen::MatrixXi &OE)
 Extract a set of edges that are overlap with a set given set of parent edges, using vertices positions to discriminate.
 
void polyfem::mesh::find_triangle_surface_from_tets (const Eigen::MatrixXi &tets, Eigen::MatrixXi &faces)
 Boundary triangles of a tet mesh, indexing the tets' vertices.
 
void polyfem::mesh::extract_triangle_surface_from_tets (const Eigen::MatrixXd &vertices, const Eigen::MatrixXi &tets, Eigen::MatrixXd &surface_vertices, Eigen::MatrixXi &tris)
 Extract triangular surface from a tetmesh.
 
bool polyfem::mesh::is_planar (const Eigen::MatrixXd &V, const double tol=1e-5)
 Determine if the given V x (2|3) vertices are planar (2D or z-range below tol).
 
int polyfem::mesh::count_faces (const int dim, const Eigen::MatrixXi &cells)
 Count the number of boundary elements (triangles for tetmesh and edges for triangle mesh)
 
void polyfem::mesh::generate_edges (PolygonMesh &M)
 Creates the edges of M (sorted by vertex pair) if it has none yet.