|
PolyFEM
|
Namespaces | |
| namespace | MeshProcessing3D |
| namespace | Navigation |
| namespace | Navigation3D |
| namespace | Polygons |
Classes | |
| class | CMesh2D |
| class | CMesh3D |
| struct | Edge |
| struct | Element |
| struct | Face |
| class | GeometryLoader |
| Applies geometry JSON semantics while delegating all decoding to MeshLoader. More... | |
| class | LoadedGeometry |
| class | LocalBoundary |
| Boundary primitive IDs for a single element. More... | |
| class | Mesh |
| Abstract mesh class to capture 2d/3d conforming and non-conforming meshes. More... | |
| class | Mesh2D |
| class | Mesh3D |
| class | Mesh3DStorage |
| struct | Mesh_Quality |
| class | MeshData |
| Format-independent input used to construct a runtime Mesh. More... | |
| class | MeshLoader |
| The only non-legacy decoder from a logical resource path to mesh data. More... | |
| class | MeshNodes |
| class | MeshReader |
| Stateless format decoders used exclusively by MeshLoader and in-memory adapters. More... | |
| struct | MeshWithID |
| class | NCMesh2D |
| class | NCMesh3D |
| class | Obstacle |
| class | SurfaceMeshData |
| struct | Vertex |
Typedefs | |
| typedef std::function< void(const Eigen::MatrixXd &, Eigen::MatrixXd &, int)> | EvalParametersFunc |
| typedef std::function< std::tuple< int, int, bool >(int, int)> | GetAdjacentLocalEdge |
| using | SurfaceMesh = SurfaceMeshData |
Enumerations | |
| enum class | CollisionProxyTessellation { REGULAR , IRREGULAR } |
| enum class | BoundaryType { TRI_LINE , QUAD_LINE , PRISM , PYRAMID , TRI , QUAD , POLYGON , POLYHEDRON , INVALID } |
| enum class | ElementType { SIMPLEX = 0 , REGULAR_INTERIOR_CUBE , SIMPLE_SINGULAR_INTERIOR_CUBE , MULTI_SINGULAR_INTERIOR_CUBE , REGULAR_BOUNDARY_CUBE , SIMPLE_SINGULAR_BOUNDARY_CUBE , MULTI_SINGULAR_BOUNDARY_CUBE , INTERFACE_CUBE , INTERIOR_POLYTOPE , BOUNDARY_POLYTOPE , PRISM , PYRAMID , UNDEFINED } |
| Type of Element, check [Poly-Spline Finite Element Method] for a complete description. More... | |
| enum class | MeshType { TRI = 0 , QUA , H_SUR , TET , HYB , HEX } |
Functions | |
| void | build_collision_proxy (const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &geom_bases, const std::vector< LocalBoundary > &total_local_boundary, const int n_bases, const int dim, const double max_edge_length, Eigen::MatrixXd &proxy_vertices, Eigen::MatrixXi &proxy_faces, std::vector< Eigen::Triplet< double > > &displacement_map_entries, const CollisionProxyTessellation tessellation) |
| void | build_collision_proxy_displacement_map (const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &geom_bases, const std::vector< mesh::LocalBoundary > &total_local_boundary, const int n_bases, const int dim, const Eigen::MatrixXd &proxy_vertices, std::vector< Eigen::Triplet< double > > &displacement_map) |
| Build a collision proxy displacement map for a given mesh and proxy mesh. | |
| void | load_collision_proxy (const io::ResourceIO &resources, const std::string &mesh_filename, const std::string &weights_filename, const Eigen::VectorXi &in_node_to_node, const json &transformation, Eigen::MatrixXd &vertices, Eigen::VectorXi &codim_vertices, Eigen::MatrixXi &edges, Eigen::MatrixXi &faces, std::vector< Eigen::Triplet< double > > &displacement_map_entries) |
| Load a collision proxy mesh and displacement map from resources. | |
| void | load_collision_proxy_mesh (const io::ResourceIO &resources, const std::string &mesh_filename, const json &transformation, Eigen::MatrixXd &vertices, Eigen::VectorXi &codim_vertices, Eigen::MatrixXi &edges, Eigen::MatrixXi &faces) |
| Load a collision proxy mesh from a resource. | |
| void | load_collision_proxy_displacement_map (const io::ResourceIO &resources, const std::string &weights_filename, const Eigen::VectorXi &in_node_to_node, const size_t num_proxy_vertices, std::vector< Eigen::Triplet< double > > &displacement_map_entries) |
| Load a collision proxy displacement map from a resource. | |
| NLOHMANN_JSON_SERIALIZE_ENUM (CollisionProxyTessellation, {{CollisionProxyTessellation::REGULAR, "regular"}, {CollisionProxyTessellation::IRREGULAR, "irregular"}}) | |
| void | build_collision_proxy (const std::vector< basis::ElementBases > &bases, const std::vector< basis::ElementBases > &geom_bases, const std::vector< mesh::LocalBoundary > &total_local_boundary, const int n_bases, const int dim, const double max_edge_length, Eigen::MatrixXd &proxy_vertices, Eigen::MatrixXi &proxy_faces, std::vector< Eigen::Triplet< double > > &displacement_map, const CollisionProxyTessellation tessellation=CollisionProxyTessellation::REGULAR) |
| Build a collision proxy mesh by upsampling a given mesh. | |
| void | stitch_mesh (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, Eigen::MatrixXd &V_out, Eigen::MatrixXi &F_out, const double epsilon=1e-5) |
| Stitch a triangle mesh (V, F) together by removing duplicate vertices. | |
| void | stitch_mesh (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const std::vector< Eigen::Triplet< double > > &W, Eigen::MatrixXd &V_out, Eigen::MatrixXi &F_out, std::vector< Eigen::Triplet< double > > &W_out, const double epsilon=1e-5) |
| Stitch a triangle mesh (V, F) together by removing duplicate vertices. | |
| double | max_edge_length (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F) |
| Compute the maximum edge length of a triangle mesh (V, F) | |
| void | regular_grid_triangle_barycentric_coordinates (const int n, Eigen::MatrixXd &V, Eigen::MatrixXi &F) |
| Compute the barycentric coordinates of a regular grid of triangles. | |
| void | regular_grid_tessellation (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const double max_edge_length, Eigen::MatrixXd &V_out, Eigen::MatrixXi &F_out) |
| Tessilate a triangle mesh (V, F) with regular grids of triangles of maximum edge length. | |
| Eigen::MatrixXd | refine_edge (const VectorNd &a, const VectorNd &b, const double max_edge_length) |
| Refine an edge (a, b) so each refined edge has length at most max_edge_length. | |
| void | refine_triangle_edges (const VectorNd &a, const VectorNd &b, const VectorNd &c, const double max_edge_len, Eigen::MatrixXd &V, Eigen::MatrixXi &E) |
| Refine the edges of a triangle (a, b, c) so each refined edge has length at most max_edge_length. | |
| void | irregular_triangle (const Eigen::Vector3d &a, const Eigen::Vector3d &b, const Eigen::Vector3d &c, const double max_edge_length, Eigen::MatrixXd &V, Eigen::MatrixXi &F) |
| Refine a triangle (a, b, c) into a well shaped triangle mesh. | |
| void | irregular_triangle_barycentric_coordinates (const Eigen::Vector3d &a, const Eigen::Vector3d &b, const Eigen::Vector3d &c, const double max_edge_length, Eigen::MatrixXd &UV, Eigen::MatrixXi &F) |
| Refine a triangle (a, b, c) into a well shaped triangle mesh. | |
| void | irregular_tessellation (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const double max_edge_length, Eigen::MatrixXd &V_out, Eigen::MatrixXi &F_out) |
| Tessilate a triangle mesh (V, F) with well shaped triangles. | |
| std::ostream & | operator<< (std::ostream &os, const LocalBoundary &lb) |
| int | find (const Eigen::VectorXi &vec, int x) |
| double | line_weight (Eigen::Matrix< double, 2, 2 > &e, Eigen::VectorXd &v) |
| void | clip_polygon_by_half_plane (const Eigen::MatrixXd &P, const Eigen::RowVector2d &q1, const Eigen::RowVector2d &q2, Eigen::MatrixXd &result) |
| Clip a polygon by a half-plane. | |
| void | compute_visibility_kernel (const Eigen::MatrixXd &IV, Eigen::MatrixXd &OV) |
| Determine the kernel of the given polygon. | |
| bool | is_star_shaped (const Eigen::MatrixXd &IV, Eigen::RowVector3d &bary) |
| Determine whether a polygon is star-shaped or not. | |
| void | offset_polygon (const Eigen::MatrixXd &IV, Eigen::MatrixXd &OV, double eps) |
| Compute offset polygon. | |
| int | is_inside (const Eigen::MatrixXd &IV, const Eigen::MatrixXd &Q, std::vector< bool > &inside) |
| Compute whether points are inside a polygon. | |
| void | sample_polygon (const Eigen::MatrixXd &IV, int num_samples, Eigen::MatrixXd &S) |
| Sample points on a polygon, evenly spaced from each other. | |
| void | edge_adjacency_graph (const Eigen::MatrixXi &Q, Eigen::MatrixXi &edge_index, std::vector< std::vector< int > > &adj, std::vector< std::pair< int, int > > *pairs_of_edges=nullptr, std::vector< std::pair< int, int > > *pairs_of_quads=nullptr, Eigen::MatrixXi *quad_index=nullptr) |
| bool | instantiate_pattern (const Eigen::MatrixXd &IV, const Eigen::MatrixXi &IF, const Eigen::MatrixXd &PV, const Eigen::MatrixXi &PF, Eigen::MatrixXd &OV, Eigen::MatrixXi &OF, Eigen::VectorXi *SF=nullptr, EvalParametersFunc evalFunc=nullptr, GetAdjacentLocalEdge getAdjLocalEdge=nullptr) |
| void | refine_quad_mesh (const Eigen::MatrixXd &IV, const Eigen::MatrixXi &IF, Eigen::MatrixXd &OV, Eigen::MatrixXi &OF) |
| void | refine_polygonal_mesh (const GEO::Mesh &M_in, GEO::Mesh &M_out, Polygons::SplitFunction split_func) |
| Refine a polygonal mesh. | |
| void | refine_triangle_mesh (const GEO::Mesh &M_in, GEO::Mesh &M_out) |
| Refine a triangle mesh. | |
| void | refine_polygonal_mesh (const GEO::Mesh &M_in, GEO::Mesh &M_out, bool refine_polygons=false, double t=0.5) |
| void | singular_vertices (const GEO::Mesh &M, Eigen::VectorXi &V, int regular_degree=4, bool ignore_border=true) |
| void | singular_edges (const GEO::Mesh &M, const Eigen::VectorXi &V, Eigen::MatrixX2i &E) |
| void | singularity_graph (const GEO::Mesh &M, Eigen::VectorXi &V, Eigen::MatrixX2i &E, int regular_degree=4, bool ignore_border=true) |
| void | create_patch_around_singularities (GEO::Mesh &M, const Eigen::VectorXi &V, const Eigen::MatrixX2i &E, double t=0.5) |
| GEO::vec3 | mesh_vertex (const GEO::Mesh &M, GEO::index_t v) |
| Retrieve a 3D vector with the position of a given vertex. | |
| GEO::vec3 | facet_barycenter (const GEO::Mesh &M, GEO::index_t f) |
| GEO::index_t | mesh_create_vertex (GEO::Mesh &M, const GEO::vec3 &p) |
| void | compute_element_tags (const GEO::Mesh &M, std::vector< ElementType > &element_tags) |
| Compute the type of each facet in a surface mesh. | |
| void | orient_normals_2d (GEO::Mesh &M) |
| Orient facets of a 2D mesh so that each connected component has positive volume. | |
| void | 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 | 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. | |
| void | to_geogram_mesh (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, GEO::Mesh &M) |
| Converts a triangle mesh to a Geogram mesh. | |
| void | from_geogram_mesh (const GEO::Mesh &M, Eigen::MatrixXd &V, Eigen::MatrixXi &F, Eigen::MatrixXi &T) |
| Extract simplices from a Geogram mesh. | |
| void | to_geogram_mesh (const Mesh3D &mesh, GEO::Mesh &M) |
| Converts a hex mesh to a Geogram mesh. | |
| double | signed_volume (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F) |
| Compute the signed volume of a surface mesh. | |
| void | orient_closed_surface (const Eigen::MatrixXd &V, Eigen::MatrixXi &F, bool positive=true) |
| Orient a triangulated surface to have positive volume. | |
| void | extract_polyhedra (const Mesh3D &mesh, std::vector< std::unique_ptr< GEO::Mesh > > &polys, bool triangulated=false) |
| Extract polyhedra from a 3D volumetric mesh. | |
| std::vector< std::pair< Navigation::Index, Navigation::Index > > | 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 > > | compute_mesh_interface (const Mesh3D &first, const Mesh3D &second) |
| Pair coincident boundary faces, including nonconforming leader/follower faces. | |
| void | sample_surface (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, int num_samples, Eigen::MatrixXd &P, Eigen::MatrixXd *N=nullptr, int num_lloyd=10, int num_newton=10) |
| Samples points on a surface. | |
| void | 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 | find_triangle_surface_from_tets (const Eigen::MatrixXi &tets, Eigen::MatrixXi &faces) |
| Boundary triangles of a tet mesh, indexing the tets' vertices. | |
| void | 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 | is_planar (const GEO::Mesh &M, const double tol=1e-5) |
| Determine if the given mesh is planar (2D or tiny z-range). | |
| int | count_faces (const int dim, const Eigen::MatrixXi &cells) |
| Count the number of boundary elements (triangles for tetmesh and edges for triangle mesh) | |
| void | generate_edges (GEO::Mesh &M) |
| assing edges to M | |
| bool | apply_slim (const Eigen::MatrixXd &V, const Eigen::MatrixXi &F, const Eigen::MatrixXd &V_new, Eigen::MatrixXd &V_smooth, const int max_iters) |
Variables | |
| constexpr long | MESH_SCHEMA_VERSION = 1 |
| The canonical typed mesh schema shared by HDF5 bundles and checkpoints. | |
| typedef std::function<void(const Eigen::MatrixXd &, Eigen::MatrixXd &, int)> polyfem::mesh::EvalParametersFunc |
Definition at line 30 of file Refinement.hpp.
| typedef std::function<std::tuple<int, int, bool>(int, int)> polyfem::mesh::GetAdjacentLocalEdge |
Definition at line 31 of file Refinement.hpp.
| using polyfem::mesh::SurfaceMesh = typedef SurfaceMeshData |
Definition at line 12 of file MeshLoader.hpp.
|
strong |
| Enumerator | |
|---|---|
| TRI_LINE | Boundary of a triangle in 2D. |
| QUAD_LINE | Boundary of a quad in 2D. |
| PRISM | |
| PYRAMID | |
| TRI | |
| QUAD | |
| POLYGON | |
| POLYHEDRON | |
| INVALID | |
Definition at line 12 of file LocalBoundary.hpp.
|
strong |
| Enumerator | |
|---|---|
| REGULAR | Regular tessellation of the mesh. |
| IRREGULAR | Irregular tessellation of the mesh (requires POLYFEM_WITH_TRIANGLE) |
Definition at line 17 of file CollisionProxy.hpp.
|
strong |
Type of Element, check [Poly-Spline Finite Element Method] for a complete description.
NOTE: For the purpose of the tagging, elements (facets in 2D, cells in 3D) adjacent to a polytope are tagged as boundary, and vertices incident to a polytope are also considered as boundary.
|
strong |
| Enumerator | |
|---|---|
| TRI | |
| QUA | |
| H_SUR | |
| TET | |
| HYB | |
| HEX | |
Definition at line 57 of file Mesh3DStorage.hpp.
| bool polyfem::mesh::apply_slim | ( | const Eigen::MatrixXd & | V, |
| const Eigen::MatrixXi & | F, | ||
| const Eigen::MatrixXd & | V_new, | ||
| Eigen::MatrixXd & | V_smooth, | ||
| const int | max_iters | ||
| ) |
Definition at line 11 of file SlimSmooth.cpp.
References polyfem::adjoint_logger(), polyfem::F, polyfem::utils::is_flipped(), polyfem::logger(), and V.
Referenced by polyfem::solver::AdjointNLProblem::after_line_search_custom_operation(), and polyfem::solver::AdjointNLProblem::is_step_valid().
| void polyfem::mesh::build_collision_proxy | ( | const std::vector< basis::ElementBases > & | bases, |
| const std::vector< basis::ElementBases > & | geom_bases, | ||
| const std::vector< LocalBoundary > & | total_local_boundary, | ||
| const int | n_bases, | ||
| const int | dim, | ||
| const double | max_edge_length, | ||
| Eigen::MatrixXd & | proxy_vertices, | ||
| Eigen::MatrixXi & | proxy_faces, | ||
| std::vector< Eigen::Triplet< double > > & | displacement_map_entries, | ||
| const CollisionProxyTessellation | tessellation | ||
| ) |
Definition at line 75 of file CollisionProxy.cpp.
References polyfem::basis::ElementBases::bases, IRREGULAR, irregular_triangle_barycentric_coordinates(), polyfem::log_and_throw_error(), max_edge_length(), REGULAR, regular_grid_triangle_barycentric_coordinates(), stitch_mesh(), TRI, and x.
Referenced by polyfem::varform::NonlinearElasticVarForm::build_collision_mesh().
| void polyfem::mesh::build_collision_proxy | ( | const std::vector< basis::ElementBases > & | bases, |
| const std::vector< basis::ElementBases > & | geom_bases, | ||
| const std::vector< mesh::LocalBoundary > & | total_local_boundary, | ||
| const int | n_bases, | ||
| const int | dim, | ||
| const double | max_edge_length, | ||
| Eigen::MatrixXd & | proxy_vertices, | ||
| Eigen::MatrixXi & | proxy_faces, | ||
| std::vector< Eigen::Triplet< double > > & | displacement_map, | ||
| const CollisionProxyTessellation | tessellation = CollisionProxyTessellation::REGULAR |
||
| ) |
Build a collision proxy mesh by upsampling a given mesh.
| [in] | bases | Bases for elements |
| [in] | geom_bases | Geometry bases for elements |
| [in] | total_local_boundary | Local boundaries for elements |
| [in] | n_bases | Number of bases (nodes) |
| [in] | dim | Dimension of the mesh |
| [in] | max_edge_length | Maximum edge length of the proxy mesh |
| [out] | proxy_vertices | Output vertices of the proxy mesh |
| [out] | proxy_faces | Output faces of the proxy mesh |
| [out] | displacement_map | Output displacement map from proxy mesh to original mesh |
| [in] | tessellation | Type of tessellation to use |
| void polyfem::mesh::build_collision_proxy_displacement_map | ( | const std::vector< basis::ElementBases > & | bases, |
| const std::vector< basis::ElementBases > & | geom_bases, | ||
| const std::vector< mesh::LocalBoundary > & | total_local_boundary, | ||
| const int | n_bases, | ||
| const int | dim, | ||
| const Eigen::MatrixXd & | proxy_vertices, | ||
| std::vector< Eigen::Triplet< double > > & | displacement_map | ||
| ) |
Build a collision proxy displacement map for a given mesh and proxy mesh.
| [in] | bases | Bases for elements |
| [in] | geom_bases | Geometry bases for elements |
| [in] | total_local_boundary | Local boundaries for elements |
| [in] | n_bases | Number of bases (nodes) |
| [in] | dim | Dimension of the mesh |
| [in] | proxy_vertices | Vertices of the proxy mesh |
| [out] | displacement_map | Output displacement map from proxy mesh to original mesh |
Definition at line 170 of file CollisionProxy.cpp.
References polyfem::log_and_throw_error().
| void polyfem::mesh::clip_polygon_by_half_plane | ( | const Eigen::MatrixXd & | P, |
| const Eigen::RowVector2d & | q1, | ||
| const Eigen::RowVector2d & | q2, | ||
| Eigen::MatrixXd & | result | ||
| ) |
Clip a polygon by a half-plane.
| [in] | P | Input polygon |
| [in] | q1 | First endpoint of the clipping line |
| [in] | q2 | Second endpoint of the clipping line |
| [out] | result | Clipped polygon |
Definition at line 51 of file PolygonUtils.cpp.
Referenced by compute_visibility_kernel().
| void polyfem::mesh::compute_element_tags | ( | const GEO::Mesh & | M, |
| std::vector< ElementType > & | element_tags | ||
| ) |
Compute the type of each facet in a surface mesh.
| [in] | M | Input surface mesh |
| [out] | element_tags | Types of each facet element |
Definition at line 94 of file MeshUtils.cpp.
Referenced by polyfem::mesh::CMesh2D::compute_elements_tag(), and polyfem::mesh::CMesh2D::update_elements_tag().
| std::vector< std::pair< polyfem::mesh::Navigation::Index, polyfem::mesh::Navigation::Index > > polyfem::mesh::compute_mesh_interface | ( | const Mesh2D & | first, |
| const Mesh2D & | second | ||
| ) |
Pair coincident boundary edges, including nonconforming leader/follower edges.
Definition at line 834 of file MeshUtils.cpp.
References polyfem::mesh::Mesh2D::get_index_from_face(), polyfem::mesh::Mesh::is_boundary_edge(), polyfem::mesh::Mesh::n_face_vertices(), polyfem::mesh::Mesh::n_faces(), polyfem::mesh::Mesh2D::next_around_face(), polyfem::mesh::Mesh::point(), and polyfem::mesh::Mesh2D::switch_vertex().
Referenced by polyfem::varform::NavierStokesFSIVarForm::load_mesh().
| std::vector< std::pair< polyfem::mesh::Navigation3D::Index, polyfem::mesh::Navigation3D::Index > > polyfem::mesh::compute_mesh_interface | ( | const Mesh3D & | first, |
| const Mesh3D & | second | ||
| ) |
Pair coincident boundary faces, including nonconforming leader/follower faces.
Definition at line 880 of file MeshUtils.cpp.
References polyfem::mesh::Mesh3D::cell_face(), polyfem::mesh::Mesh::face_vertex(), faces, polyfem::mesh::Mesh3D::get_index_from_element(), polyfem::mesh::Mesh::is_boundary_face(), polyfem::mesh::Mesh3D::n_cell_faces(), polyfem::mesh::Mesh::n_cells(), polyfem::mesh::Mesh::n_face_vertices(), polyfem::mesh::Mesh3D::next_around_face(), and polyfem::mesh::Mesh::point().
| void polyfem::mesh::compute_visibility_kernel | ( | const Eigen::MatrixXd & | IV, |
| Eigen::MatrixXd & | OV | ||
| ) |
Determine the kernel of the given polygon.
| [in] | IV | #IV x (2|3) vertex positions around the input polygon |
| [out] | OV | #OV x (2|3) vertex positions around the output polygon |
Definition at line 121 of file PolygonUtils.cpp.
References clip_polygon_by_half_plane().
Referenced by is_star_shaped().
| 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)
Definition at line 1253 of file MeshUtils.cpp.
| void polyfem::mesh::create_patch_around_singularities | ( | GEO::Mesh & | M, |
| const Eigen::VectorXi & | V, | ||
| const Eigen::MatrixX2i & | E, | ||
| double | t = 0.5 |
||
| ) |
Definition at line 84 of file Singularities.cpp.
References facet_barycenter(), mesh_create_vertex(), mesh_vertex(), and V.
| void polyfem::mesh::edge_adjacency_graph | ( | const Eigen::MatrixXi & | Q, |
| Eigen::MatrixXi & | edge_index, | ||
| std::vector< std::vector< int > > & | adj, | ||
| std::vector< std::pair< int, int > > * | pairs_of_edges = nullptr, |
||
| std::vector< std::pair< int, int > > * | pairs_of_quads = nullptr, |
||
| Eigen::MatrixXi * | quad_index = nullptr |
||
| ) |
Definition at line 16 of file Refinement.cpp.
Referenced by instantiate_pattern().
| 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.
| [in] | IV | #IV x 3 input vertices positions |
| [in] | IE | #IE x 2 input edge indices |
| [in] | BV | #BV x 3 base vertices positions to test against |
| [in] | BE | #BE x 2 base edge indices to test against |
| [out] | OE | #OE x 2 output extracted edges |
Definition at line 1140 of file MeshUtils.cpp.
Referenced by polyfem::utils::RefElementSampler::build().
| void polyfem::mesh::extract_polyhedra | ( | const Mesh3D & | mesh, |
| std::vector< std::unique_ptr< GEO::Mesh > > & | polys, | ||
| bool | triangulated = false |
||
| ) |
Extract polyhedra from a 3D volumetric mesh.
| [in] | mesh | Input volume mesh |
| [out] | polys | Extracted polyhedral surfaces |
Definition at line 924 of file MeshUtils.cpp.
References polyfem::mesh::Mesh3D::get_index_from_element(), polyfem::mesh::Mesh::is_polytope(), polyfem::mesh::Mesh3D::kernel(), polyfem::mesh::Mesh3D::n_cell_faces(), polyfem::mesh::Mesh::n_cell_vertices(), polyfem::mesh::Mesh::n_cells(), polyfem::mesh::Mesh::n_face_vertices(), polyfem::mesh::Mesh::n_faces(), polyfem::mesh::Mesh::n_vertices(), polyfem::mesh::Mesh3D::next_around_face(), and polyfem::mesh::Mesh::point().
| 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.
| [in] | v,tets | tet mesh |
| [out] | s_v,tris | { surface mesh } |
Definition at line 1214 of file MeshUtils.cpp.
References find_triangle_surface_from_tets().
Referenced by polyfem::mesh::MeshReader::read_msh_surface().
| GEO::vec3 polyfem::mesh::facet_barycenter | ( | const GEO::Mesh & | M, |
| GEO::index_t | f | ||
| ) |
Definition at line 61 of file MeshUtils.cpp.
References mesh_vertex().
Referenced by create_patch_around_singularities(), and refine_polygonal_mesh().
| int polyfem::mesh::find | ( | const Eigen::VectorXi & | vec, |
| int | x | ||
| ) |
Definition at line 341 of file NCMesh2D.cpp.
Referenced by polyfem::mesh::MeshProcessing3D::build_connectivity(), polyfem::mesh::NCMesh2D::build_element_vertex_adjacency(), polyfem::mesh::Navigation3D::get_index_from_element_face(), polyfem::io::ResourceIO::glob(), polyfem::mesh::MeshProcessing3D::refine_catmul_clark_polar(), and polyfem::mesh::NCMesh2D::switch_edge().
| 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.
| [in] | tets | #T x 4 tet indices |
| [out] | faces | F x 3 boundary triangle indices |
Definition at line 1180 of file MeshUtils.cpp.
References faces.
Referenced by extract_triangle_surface_from_tets(), and polyfem::mesh::MeshReader::read_msh_surface().
| void polyfem::mesh::from_geogram_mesh | ( | const GEO::Mesh & | M, |
| Eigen::MatrixXd & | V, | ||
| Eigen::MatrixXi & | F, | ||
| Eigen::MatrixXi & | T | ||
| ) |
| void polyfem::mesh::generate_edges | ( | GEO::Mesh & | M | ) |
assing edges to M
| [in/out] | M geogram mesh to appen edges to |
Definition at line 1303 of file MeshUtils.cpp.
Referenced by polyfem::mesh::CMesh2D::refine().
| bool polyfem::mesh::instantiate_pattern | ( | const Eigen::MatrixXd & | IV, |
| const Eigen::MatrixXi & | IF, | ||
| const Eigen::MatrixXd & | PV, | ||
| const Eigen::MatrixXi & | PF, | ||
| Eigen::MatrixXd & | OV, | ||
| Eigen::MatrixXi & | OF, | ||
| Eigen::VectorXi * | SF = nullptr, |
||
| EvalParametersFunc | evalFunc = nullptr, |
||
| GetAdjacentLocalEdge | getAdjLocalEdge = nullptr |
||
| ) |
Definition at line 276 of file Refinement.cpp.
References adj, edge_adjacency_graph(), polyfem::F, polyfem::logger(), V, x, and y.
Referenced by refine_quad_mesh().
| void polyfem::mesh::irregular_tessellation | ( | const Eigen::MatrixXd & | V, |
| const Eigen::MatrixXi & | F, | ||
| const double | max_edge_length, | ||
| Eigen::MatrixXd & | V_out, | ||
| Eigen::MatrixXi & | F_out | ||
| ) |
Tessilate a triangle mesh (V, F) with well shaped triangles.
| V | vertices |
| F | triangular faces |
| max_edge_length | maximum edge length |
| V_out | tessilated vertices |
| F_out | tessilated faces |
Definition at line 288 of file UpsampleMesh.cpp.
References polyfem::F, irregular_triangle(), max_edge_length(), stitch_mesh(), and V.
| void polyfem::mesh::irregular_triangle | ( | const Eigen::Vector3d & | a, |
| const Eigen::Vector3d & | b, | ||
| const Eigen::Vector3d & | c, | ||
| const double | max_edge_length, | ||
| Eigen::MatrixXd & | V, | ||
| Eigen::MatrixXi & | F | ||
| ) |
Refine a triangle (a, b, c) into a well shaped triangle mesh.
| a | first vertex of the triangle |
| b | second vertex of the triangle |
| c | third vertex of the triangle |
| max_edge_len | maximum edge length of the refined triangle mesh |
| V | vertices of the refined triangle |
| F | faces of the refined triangle |
Definition at line 217 of file UpsampleMesh.cpp.
References polyfem::assembler::cross(), polyfem::F, polyfem::log_and_throw_error(), max_edge_length(), refine_triangle_edges(), polyfem::utils::triangle_area(), V, and z.
Referenced by irregular_tessellation(), and irregular_triangle_barycentric_coordinates().
| void polyfem::mesh::irregular_triangle_barycentric_coordinates | ( | const Eigen::Vector3d & | a, |
| const Eigen::Vector3d & | b, | ||
| const Eigen::Vector3d & | c, | ||
| const double | max_edge_length, | ||
| Eigen::MatrixXd & | UV, | ||
| Eigen::MatrixXi & | F | ||
| ) |
Refine a triangle (a, b, c) into a well shaped triangle mesh.
| a | first vertex of the triangle |
| b | second vertex of the triangle |
| c | third vertex of the triangle |
| max_edge_len | maximum edge length of the refined triangle mesh |
| UV | barycentric coordinates of the refined triangle |
| F | faces of the refined triangle |
Definition at line 266 of file UpsampleMesh.cpp.
References polyfem::F, irregular_triangle(), max_edge_length(), and V.
Referenced by build_collision_proxy().
| int polyfem::mesh::is_inside | ( | const Eigen::MatrixXd & | IV, |
| const Eigen::MatrixXd & | Q, | ||
| std::vector< bool > & | inside | ||
| ) |
Compute whether points are inside a polygon.
| [in] | IV | #IV x 2 of vertex positions for the input polygon |
| [in] | Q | #Q x 2 of query point positions |
| [out] | inside | Whether the i-th query point is inside or not |
Definition at line 239 of file PolygonUtils.cpp.
| bool polyfem::mesh::is_planar | ( | const GEO::Mesh & | M, |
| const double | tol = 1e-5 |
||
| ) |
Determine if the given mesh is planar (2D or tiny z-range).
Definition at line 28 of file MeshUtils.cpp.
Referenced by polyfem::mesh::MeshReader::from_geogram(), and polyfem::mesh::MeshReader::read_geogram_surface().
| bool polyfem::mesh::is_star_shaped | ( | const Eigen::MatrixXd & | IV, |
| Eigen::RowVector3d & | bary | ||
| ) |
Determine whether a polygon is star-shaped or not.
| [in] | IV | #IV x (2|3) of vertex positions around the polygon |
| [out] | bary | The barycenter of the kernel |
Definition at line 149 of file PolygonUtils.cpp.
References compute_visibility_kernel(), and F.
Referenced by polyfem::mesh::Polygons::catmul_clark_split(), and polyfem::mesh::Polygons::polar_split().
| double polyfem::mesh::line_weight | ( | Eigen::Matrix< double, 2, 2 > & | e, |
| Eigen::VectorXd & | v | ||
| ) |
Definition at line 416 of file NCMesh2D.cpp.
Referenced by polyfem::mesh::NCMesh2D::build_element_vertex_adjacency().
| void polyfem::mesh::load_collision_proxy | ( | const io::ResourceIO & | resources, |
| const std::string & | mesh_filename, | ||
| const std::string & | weights_filename, | ||
| const Eigen::VectorXi & | in_node_to_node, | ||
| const json & | transformation, | ||
| Eigen::MatrixXd & | vertices, | ||
| Eigen::VectorXi & | codim_vertices, | ||
| Eigen::MatrixXi & | edges, | ||
| Eigen::MatrixXi & | faces, | ||
| std::vector< Eigen::Triplet< double > > & | displacement_map_entries | ||
| ) |
Load a collision proxy mesh and displacement map from resources.
| [in] | mesh_filename | Mesh resource path |
| [in] | weights_filename | Weights resource path |
| [in] | in_node_to_node | Map from input node IDs to node IDs |
| [in] | transformation | Transformation to apply to the mesh |
| [out] | vertices | Output vertices of the proxy mesh |
| [out] | codim_vertices | Output codimension vertices of the proxy mesh |
| [out] | edges | Output edges of the proxy mesh |
| [out] | faces | Output faces of the proxy mesh |
| [out] | displacement_map_entries | Output displacement map entries |
Definition at line 317 of file CollisionProxy.cpp.
References faces, load_collision_proxy(), load_collision_proxy_displacement_map(), and load_collision_proxy_mesh().
Referenced by polyfem::varform::NonlinearElasticVarForm::build_collision_mesh(), and load_collision_proxy().
| void polyfem::mesh::load_collision_proxy_displacement_map | ( | const io::ResourceIO & | resources, |
| const std::string & | weights_filename, | ||
| const Eigen::VectorXi & | in_node_to_node, | ||
| const size_t | num_proxy_vertices, | ||
| std::vector< Eigen::Triplet< double > > & | displacement_map_entries | ||
| ) |
Load a collision proxy displacement map from a resource.
| [in] | weights_filename | Weights resource path |
| [in] | in_node_to_node | Map from input node IDs to node IDs |
| [out] | displacement_map_entries | Output displacement map entries |
Definition at line 375 of file CollisionProxy.cpp.
References polyfem::io::ResourceIO::is_group(), load_collision_proxy_displacement_map(), polyfem::io::ResourceIO::materialize(), polyfem::io::ResourceIO::read_double_vector(), polyfem::io::ResourceIO::read_int_vector(), polyfem::io::ResourceIO::read_shape_attribute(), and weights.
Referenced by load_collision_proxy(), and load_collision_proxy_displacement_map().
| void polyfem::mesh::load_collision_proxy_mesh | ( | const io::ResourceIO & | resources, |
| const std::string & | mesh_filename, | ||
| const json & | transformation, | ||
| Eigen::MatrixXd & | vertices, | ||
| Eigen::VectorXi & | codim_vertices, | ||
| Eigen::MatrixXi & | edges, | ||
| Eigen::MatrixXi & | faces | ||
| ) |
Load a collision proxy mesh from a resource.
| [in] | mesh_filename | Mesh resource path |
| [in] | transformation | Transformation to apply to the mesh |
| [out] | vertices | Output vertices of the proxy mesh |
| [out] | codim_vertices | Output codimension vertices of the proxy mesh |
| [out] | edges | Output edges of the proxy mesh |
| [out] | faces | Output faces of the proxy mesh |
Definition at line 333 of file CollisionProxy.cpp.
References polyfem::mesh::SurfaceMeshData::edges, faces, polyfem::mesh::SurfaceMeshData::faces, load_collision_proxy_mesh(), polyfem::mesh::MeshLoader::load_surface(), polyfem::mesh::SurfaceMeshData::points, and polyfem::mesh::SurfaceMeshData::vertices.
Referenced by load_collision_proxy(), and load_collision_proxy_mesh().
| double polyfem::mesh::max_edge_length | ( | const Eigen::MatrixXd & | V, |
| const Eigen::MatrixXi & | F | ||
| ) |
Compute the maximum edge length of a triangle mesh (V, F)
| V | vertices |
| F | triangular faces |
Definition at line 87 of file UpsampleMesh.cpp.
References polyfem::F, max_edge_length(), and V.
Referenced by build_collision_proxy(), irregular_tessellation(), irregular_triangle(), irregular_triangle_barycentric_coordinates(), max_edge_length(), refine_edge(), and regular_grid_tessellation().
| GEO::index_t polyfem::mesh::mesh_create_vertex | ( | GEO::Mesh & | M, |
| const GEO::vec3 & | p | ||
| ) |
Definition at line 74 of file MeshUtils.cpp.
Referenced by create_patch_around_singularities(), refine_polygonal_mesh(), and refine_triangle_mesh().
| GEO::vec3 polyfem::mesh::mesh_vertex | ( | const GEO::Mesh & | M, |
| GEO::index_t | v | ||
| ) |
Retrieve a 3D vector with the position of a given vertex.
Contrary to geogram's version, this function works with both single and double precision meshes, as well as 2D meshes too.
| [in] | M | Input mesh |
| [in] | v | Vertex index whose position to retrieve |
Definition at line 41 of file MeshUtils.cpp.
Referenced by create_patch_around_singularities(), facet_barycenter(), refine_polygonal_mesh(), and refine_triangle_mesh().
| polyfem::mesh::NLOHMANN_JSON_SERIALIZE_ENUM | ( | CollisionProxyTessellation | , |
| {{CollisionProxyTessellation::REGULAR, "regular"}, {CollisionProxyTessellation::IRREGULAR, "irregular"}} | |||
| ) |
| void polyfem::mesh::offset_polygon | ( | const Eigen::MatrixXd & | IV, |
| Eigen::MatrixXd & | OV, | ||
| double | eps | ||
| ) |
Compute offset polygon.
| [in] | IV | #IV x 2 of vertex positions for the input polygon |
| [out] | OV | #OV x 2 of vertex positions for the offset polygon |
| [in] | eps | Offset distance |
Definition at line 175 of file PolygonUtils.cpp.
| std::ostream & polyfem::mesh::operator<< | ( | std::ostream & | os, |
| const LocalBoundary & | lb | ||
| ) |
| os | Output stream |
| lb | LocalBoundary to print |
Definition at line 49 of file LocalBoundary.cpp.
| void polyfem::mesh::orient_closed_surface | ( | const Eigen::MatrixXd & | V, |
| Eigen::MatrixXi & | F, | ||
| bool | positive = true |
||
| ) |
Orient a triangulated surface to have positive volume.
| [in] | V | V x 3 input mesh vertices |
| [in] | F | F x 3 input mesh facets |
| [in] | positive | Orient for positive volume, or negative volume |
Definition at line 698 of file MeshUtils.cpp.
References F, signed_volume(), and V.
Referenced by polyfem::basis::PolygonalBasis3d::build_bases().
| void polyfem::mesh::orient_normals_2d | ( | GEO::Mesh & | M | ) |
Orient facets of a 2D mesh so that each connected component has positive volume.
| [in,out] | M | Surface mesh to reorient |
Definition at line 300 of file MeshUtils.cpp.
Referenced by polyfem::mesh::CMesh2D::build_topology(), and polyfem::mesh::NCMesh2D::build_topology().
| Eigen::MatrixXd polyfem::mesh::refine_edge | ( | const VectorNd & | a, |
| const VectorNd & | b, | ||
| const double | max_edge_length | ||
| ) |
Refine an edge (a, b) so each refined edge has length at most max_edge_length.
| a | first vertex of the edge |
| b | second vertex of the edge |
| max_edge_length | maximum edge length |
Definition at line 183 of file UpsampleMesh.cpp.
References max_edge_length(), and V.
Referenced by refine_triangle_edges().
|
inline |
Definition at line 137 of file Refinement.hpp.
References polyfem::mesh::Polygons::no_split_func(), polyfem::mesh::Polygons::polar_split_func(), and refine_polygonal_mesh().
| void polyfem::mesh::refine_polygonal_mesh | ( | const GEO::Mesh & | M_in, |
| GEO::Mesh & | M_out, | ||
| Polygons::SplitFunction | split_func | ||
| ) |
Refine a polygonal mesh.
Quads and triangles are split into quads. If refine_polygons is set to true, then polygonal facets are also split into a layer of padding quads, and a new polygon is created around the barycenter
| [in] | M_in | Surface mesh to subdivide |
| [out] | M_out | Refined mesh |
| [in] | split_func | Functional used to split the new polygon interiors (boundary has already been split) |
Definition at line 613 of file Refinement.cpp.
References polyfem::mesh::Navigation::Index::edge, polyfem::F, facet_barycenter(), polyfem::mesh::Navigation::get_index_from_face(), mesh_create_vertex(), mesh_vertex(), polyfem::mesh::Navigation::next_around_face(), polyfem::mesh::Navigation::switch_edge(), polyfem::mesh::Navigation::switch_vertex(), V, and polyfem::mesh::Navigation::Index::vertex.
Referenced by polyfem::mesh::CMesh2D::refine(), and refine_polygonal_mesh().
| void polyfem::mesh::refine_quad_mesh | ( | const Eigen::MatrixXd & | IV, |
| const Eigen::MatrixXi & | IF, | ||
| Eigen::MatrixXd & | OV, | ||
| Eigen::MatrixXi & | OF | ||
| ) |
Definition at line 502 of file Refinement.cpp.
References instantiate_pattern().
| void polyfem::mesh::refine_triangle_edges | ( | const VectorNd & | a, |
| const VectorNd & | b, | ||
| const VectorNd & | c, | ||
| const double | max_edge_len, | ||
| Eigen::MatrixXd & | V, | ||
| Eigen::MatrixXi & | E | ||
| ) |
Refine the edges of a triangle (a, b, c) so each refined edge has length at most max_edge_length.
| a | first vertex of the triangle |
| b | second vertex of the triangle |
| c | third vertex of the triangle |
| max_edge_len | maximum edge length |
| V | vertices of the refined edges |
| E | refined edges |
Definition at line 194 of file UpsampleMesh.cpp.
References refine_edge(), and V.
Referenced by irregular_triangle().
| void polyfem::mesh::refine_triangle_mesh | ( | const GEO::Mesh & | M_in, |
| GEO::Mesh & | M_out | ||
| ) |
Refine a triangle mesh.
Each input triangle is split into 4 new triangles
| [in] | M_in | Input surface mesh |
| [out] | M_out | Output surface mesh |
Definition at line 727 of file Refinement.cpp.
References polyfem::mesh::Navigation::Index::edge, polyfem::mesh::Navigation::get_index_from_face(), mesh_create_vertex(), mesh_vertex(), polyfem::mesh::Navigation::next_around_face(), polyfem::mesh::Navigation::switch_edge(), polyfem::mesh::Navigation::switch_vertex(), and polyfem::mesh::Navigation::Index::vertex.
Referenced by polyfem::mesh::CMesh2D::refine().
| void polyfem::mesh::regular_grid_tessellation | ( | const Eigen::MatrixXd & | V, |
| const Eigen::MatrixXi & | F, | ||
| const double | max_edge_length, | ||
| Eigen::MatrixXd & | V_out, | ||
| Eigen::MatrixXi & | F_out | ||
| ) |
Tessilate a triangle mesh (V, F) with regular grids of triangles of maximum edge length.
| V | vertices |
| F | triangular faces |
| max_edge_length | maximum edge length |
| V_out | tessilated vertices |
| F_out | tessilated faces |
Definition at line 148 of file UpsampleMesh.cpp.
References polyfem::F, max_edge_length(), regular_grid_triangle_barycentric_coordinates(), stitch_mesh(), and V.
| void polyfem::mesh::regular_grid_triangle_barycentric_coordinates | ( | const int | n, |
| Eigen::MatrixXd & | V, | ||
| Eigen::MatrixXi & | F | ||
| ) |
Compute the barycentric coordinates of a regular grid of triangles.
| [in] | n | Number of triangles along each edge |
| [out] | V | Vertices of the regular grid |
| [out] | F | Faces of the regular grid |
Definition at line 104 of file UpsampleMesh.cpp.
References polyfem::F, and V.
Referenced by build_collision_proxy(), and regular_grid_tessellation().
| 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.
| [in,out] | V | V x d input mesh vertices |
| [in,out] | F | F x k input mesh faces |
| [in] | C | V per vertex color tag |
| [out] | R | max(C)+1 vector of starting indices for each colors (last value is the total number of vertices) |
Definition at line 321 of file MeshUtils.cpp.
| void polyfem::mesh::sample_polygon | ( | const Eigen::MatrixXd & | IV, |
| int | num_samples, | ||
| Eigen::MatrixXd & | S | ||
| ) |
Sample points on a polygon, evenly spaced from each other.
| [in] | IV | #IV x 2 vertex positions for the input polygon |
| [in] | num_samples | Desired number of samples |
| [out] | S | #S x 2 output sample positions |
Definition at line 261 of file PolygonUtils.cpp.
Referenced by polyfem::basis::PolygonalBasis2d::build_bases().
| void polyfem::mesh::sample_surface | ( | const Eigen::MatrixXd & | V, |
| const Eigen::MatrixXi & | F, | ||
| int | num_samples, | ||
| Eigen::MatrixXd & | P, | ||
| Eigen::MatrixXd * | N = nullptr, |
||
| int | num_lloyd = 10, |
||
| int | num_newton = 10 |
||
| ) |
Samples points on a surface.
| [in] | V | V x 3 input mesh vertices |
| [in] | F | F x 3 input mesh facets |
| [in] | num_samples | Number of desired samples |
| [out] | P | num_samples x 3 sample points positions |
| [out] | N | num_samples x 3 of normals estimated from the original surface (optional argument) |
| [in] | num_lloyd | Number of Lloyd iterations |
| [in] | num_newton | Number of Newton iterations |
Definition at line 1078 of file MeshUtils.cpp.
References F, to_geogram_mesh(), and V.
| 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.
This function build a AABB tree of the input mesh, computes the distance for each query point to the closest triangle, and then determines the sign by casting a vertical ray from the query point and counting the number of intersections with the input mesh
| [in] | V | V x 3 input mesh vertices |
| [in] | F | F x 3 input mesh faces |
| [in] | P | #P x 3 query points |
| D | #P x 1 computed signed distances, negative inside, positive outside |
Definition at line 665 of file MeshUtils.cpp.
References F, to_geogram_mesh(), and V.
| double polyfem::mesh::signed_volume | ( | const Eigen::MatrixXd & | V, |
| const Eigen::MatrixXi & | F | ||
| ) |
Compute the signed volume of a surface mesh.
Definition at line 677 of file MeshUtils.cpp.
Referenced by orient_closed_surface(), and polyfem::mesh::MeshProcessing3D::refine_red_refinement_tet().
| void polyfem::mesh::singular_edges | ( | const GEO::Mesh & | M, |
| const Eigen::VectorXi & | V, | ||
| Eigen::MatrixX2i & | E | ||
| ) |
Definition at line 48 of file Singularities.cpp.
References V.
Referenced by singularity_graph().
| void polyfem::mesh::singular_vertices | ( | const GEO::Mesh & | M, |
| Eigen::VectorXi & | V, | ||
| int | regular_degree = 4, |
||
| bool | ignore_border = true |
||
| ) |
Definition at line 8 of file Singularities.cpp.
References V.
Referenced by singularity_graph().
| void polyfem::mesh::singularity_graph | ( | const GEO::Mesh & | M, |
| Eigen::VectorXi & | V, | ||
| Eigen::MatrixX2i & | E, | ||
| int | regular_degree = 4, |
||
| bool | ignore_border = true |
||
| ) |
Definition at line 75 of file Singularities.cpp.
References singular_edges(), singular_vertices(), and V.
| void polyfem::mesh::stitch_mesh | ( | const Eigen::MatrixXd & | V, |
| const Eigen::MatrixXi & | F, | ||
| const std::vector< Eigen::Triplet< double > > & | W, | ||
| Eigen::MatrixXd & | V_out, | ||
| Eigen::MatrixXi & | F_out, | ||
| std::vector< Eigen::Triplet< double > > & | W_out, | ||
| const double | epsilon = 1e-5 |
||
| ) |
Stitch a triangle mesh (V, F) together by removing duplicate vertices.
Also removes weights in W that correspond to duplicate vertices.
| [in] | V | Input vertices |
| [in] | F | Input faces |
| [in] | W | Input weights |
| [out] | V_out | Output vertices (duplicate vertices removed) |
| [out] | F_out | Output faces (updated to use V_out) |
| [out] | W_out | Output weights (updated to use V_out) |
| [in] | epsilon | Tolerance for duplicate vertices |
indices: #V_out by 1 list of indices so V_out = V(indices,:) inverse: V by 1 list of indices so V = V_out(inverse,:)
Definition at line 46 of file UpsampleMesh.cpp.
References polyfem::F, polyfem::utils::inverse(), and V.
| void polyfem::mesh::stitch_mesh | ( | const Eigen::MatrixXd & | V, |
| const Eigen::MatrixXi & | F, | ||
| Eigen::MatrixXd & | V_out, | ||
| Eigen::MatrixXi & | F_out, | ||
| const double | epsilon = 1e-5 |
||
| ) |
Stitch a triangle mesh (V, F) together by removing duplicate vertices.
| [in] | V | Input vertices |
| [in] | F | Input faces |
| [out] | V_out | Output vertices (duplicate vertices removed) |
| [out] | F_out | Output faces (updated to use V_out) |
| [in] | epsilon | Tolerance for duplicate vertices |
Definition at line 35 of file UpsampleMesh.cpp.
References polyfem::F, stitch_mesh(), and V.
Referenced by build_collision_proxy(), irregular_tessellation(), regular_grid_tessellation(), and stitch_mesh().
| void polyfem::mesh::to_geogram_mesh | ( | const Eigen::MatrixXd & | V, |
| const Eigen::MatrixXi & | F, | ||
| GEO::Mesh & | M | ||
| ) |
Converts a triangle mesh to a Geogram mesh.
Definition at line 571 of file MeshUtils.cpp.
Referenced by polyfem::mesh::NCMesh2D::build_topology(), sample_surface(), and signed_squared_distances().
| void polyfem::mesh::to_geogram_mesh | ( | const Mesh3D & | mesh, |
| GEO::Mesh & | M | ||
| ) |
Converts a hex mesh to a Geogram mesh.
| [in] | mesh | Input mesh |
| [out] | M | Output Geogram mesh |
Definition at line 1020 of file MeshUtils.cpp.
References polyfem::mesh::Mesh::face_vertex(), polyfem::mesh::Mesh3D::get_ordered_vertices_from_hex(), polyfem::mesh::Mesh::is_boundary_face(), polyfem::mesh::Mesh::is_cube(), polyfem::mesh::Mesh::n_cells(), polyfem::mesh::Mesh::n_face_vertices(), polyfem::mesh::Mesh::n_faces(), polyfem::mesh::Mesh::n_vertices(), and polyfem::mesh::Mesh::point().
|
inlineconstexpr |
The canonical typed mesh schema shared by HDF5 bundles and checkpoints.
Definition at line 10 of file MeshLoader.hpp.
Referenced by polyfem::mesh::MeshLoader::validate_group(), and polyfem::io::CheckpointWriter::write_mesh().