private static void AssignSurface(List<Vertex> vertices, int from, int to) { foreach (Vertex v in vertices) { if (v != null && v.surface_index == from) v.surface_index = to; } }