Iterate over Triangles in Tetrahedron Data (without redundancies)

Hey there!
I am currently working with a vtkUnstructuredGrid object that is made up of a collection of tetrahedron cells. I now want to iterate over all triangles.
One way to do so ist to use the GetCellData(); function, but this will lead to a list of tetrahedra, which I can then use to visit all faces. This leads to several triangles being visited twice, which is a significant overhead. Does VTK offer a better way that I just haven’t found yet?

There was a similar question, which was never really answered.

Thanks for any responses,

I answered your question in the discourse thread…

Thanks for the suggestion, I thought of a similar way to approach this.
But you would also say, that there is no straightforward function that would provide, e.g., an array of all unique triangles?

That’s a good suggestion, but I believe the current philosophy is that such a face structure would be too slow and too memory inefficient. However, for all I know there may be a filter (or filter combination) that can do what you want but nothing is coming to me at the moment. Are you willing to try writing some code and creating a MR? It could be added to vtkUnstructuredGridBase with an implementation in vtkUnstructuredGrid.

Yeah, I was thinking about doing that. Let’s see, it might result as a sideproduct of my current project.
Thanks for your suggestions.