Comments and answers for "Any way to find neighboring vertices of a vertex?"
http://answers.unity.com/questions/1563158/any-way-to-find-neighboring-vertices-of-a-vertex.html
The latest comments and answers for the question "Any way to find neighboring vertices of a vertex?"Answer by Bunny83
http://answers.unity.com/answers/1563196/view.html
[Tried google][1]?
<br>
The first 3 relevant results:
- [https://answers.unity.com/questions/1373674/find-neighbouring-vertices-in-a-mesh.html][2]
- [https://answers.unity.com/questions/371115/is-there-an-easy-way-to-find-connected-vertices.html][3]
- [https://answers.unity.com/questions/388333/is-there-any-way-to-find-connected-vertices-in-a-m.html][4]
<br>
The short answer is: no. First you have to make clear what you mean by neighboring. Just vertices close to each other without any other vertices in between, or just vertices that are connected by a triangle edge? Next keep in mind that a mesh could have duplicated vertices. Should they count as one vertex?
<br>
Finding all neighbors for all vertices is an O(n²) operation. However this information could be stored in a datastructure. Quick and dirty an array of lists of integers (`List<int>[]`) Now add a List for each vertex in your mesh. So the index into the array will match with the vertex index. The corresponding list can be filled with the neighbor vertices. So you can simply look up the neighbors for a certain vertex.
[1]: https://www.google.de/search?safe=off&q=unity+answers+neighbor+vertices
[2]: https://answers.unity.com/questions/1373674/find-neighbouring-vertices-in-a-mesh.html
[3]: https://answers.unity.com/questions/371115/is-there-an-easy-way-to-find-connected-vertices.html
[4]: https://answers.unity.com/questions/388333/is-there-any-way-to-find-connected-vertices-in-a-m.htmlTue, 16 Oct 2018 18:55:18 GMTBunny83