/// <summary> /// Computes vertex adjacency for the whole mesh and stores it in the appropriate dictionaries. /// </summary> public void ComputeVertexAdjacency() { foreach (MeshVertex vertex in mesh.Vertices) { foreach (MeshVertex adjacent in vertex.AdjacentVertices()) { if (!VertexVertex.ContainsKey(vertex.Index)) { VertexVertex.Add(vertex.Index, new List <int>() { adjacent.Index }); } else { VertexVertex[vertex.Index].Add(adjacent.Index); } } foreach (MeshFace adjacent in vertex.AdjacentFaces()) { if (!VertexFaces.ContainsKey(vertex.Index)) { VertexFaces.Add(vertex.Index, new List <int>() { adjacent.Index }); } else { VertexFaces[vertex.Index].Add(adjacent.Index); } } foreach (MeshEdge adjacent in vertex.AdjacentEdges()) { if (!VertexEdges.ContainsKey(vertex.Index)) { VertexEdges.Add(vertex.Index, new List <int>() { adjacent.Index }); } else { VertexEdges[vertex.Index].Add(adjacent.Index); } } } }