PolyFEM
Loading...
Searching...
No Matches
Navigation.hpp
Go to the documentation of this file.
1#pragma once
2
4
5namespace polyfem
6{
7 namespace mesh
8 {
9 namespace Navigation
10 {
11
12 struct Index
13 {
14 int vertex;
15 int edge;
16 int face;
18 };
19
20 // Computes connectivity information on a surface mesh
21 // Marks both boundary edges and vertices
23
24 // Retrieves the index (v,e,f) of one vertex incident to the given face
25 Index get_index_from_face(const PolygonMesh &M, int f, int lv);
26
27 // Navigation in a surface mesh
28 Index switch_vertex(const PolygonMesh &M, Index idx);
29 Index switch_edge(const PolygonMesh &M, Index idx);
30 Index switch_face(const PolygonMesh &M, Index idx);
31
32 // Iterate in a mesh
33 inline Index next_around_face(const PolygonMesh &M, Index idx) { return switch_edge(M, switch_vertex(M, idx)); }
34 inline Index next_around_edge(const PolygonMesh &M, Index idx) { return switch_vertex(M, switch_face(M, idx)); }
35 inline Index next_around_vertex(const PolygonMesh &M, Index idx) { return switch_face(M, switch_edge(M, idx)); }
36
37 } // namespace Navigation
38 } // namespace mesh
39} // namespace polyfem
Minimal polygonal surface mesh used as the storage of CMesh2D.
Index next_around_edge(const PolygonMesh &M, Index idx)
Index switch_face(const PolygonMesh &M, Index idx)
Index get_index_from_face(const PolygonMesh &M, int f, int lv)
Index switch_edge(const PolygonMesh &M, Index idx)
void prepare_mesh(PolygonMesh &M)
Index next_around_face(const PolygonMesh &M, Index idx)
Index switch_vertex(const PolygonMesh &M, Index idx)
Index next_around_vertex(const PolygonMesh &M, Index idx)