I have a mesh in a form like this.
with a list of indices representing each polygon at the end. I need to generate a list of neighboring polygons for each polygon, and was w
Without precomputed data it is not possible to do it faster than looping through all faces.
For precomputed data it is enough for each vertex to hold a list of faces where it is used. Finding neighbors is done with intersecting face lists of 2 vertices.