I have a grid with certain types of elements (e.g. triangular, tetra). For each element, I know all its vertices, i.e. A triangular two-dimensional element will have 3 vertices v1, v2 and v3, whose x, y, z-coordinates are known.
Question 1
I am looking for an algorithm that will return all edges ... in this case:
edge (v1, v2), edge (v1, v3), edge (v2, v3). Based on how many vertices each element has, the algorithm must efficiently determine edges.
Question 2
I use C ++, so what would be the most efficient way to store information about the edges returned by the above algorithm? For example, all that interests me is the tuple (v1, v2), which I want to use for some calculations, and then forget about it.
thank
source
share