예제 #1
0
        private int[] GetRegions(IMesh mesh)
        {
            mesh.Renumber();

            var labels  = new int[mesh.Triangles.Count];
            var regions = new SortedSet <int>();

            foreach (var t in mesh.Triangles)
            {
                labels[t.ID] = t.Label;
                regions.Add(t.Label);
            }

            if (colors.ColorDictionary == null)
            {
                colors.CreateColorDictionary(regions, regions.Count);
            }

            return(labels);
        }