private static void BuildShape() { //each "shape" may contain more than one shape (e.g. a zig-zag on the southern hemisphere between two octahedral faces will have #zig + #zag + 1 shapes) edge_pattern = new Dictionary <QuadraticBezier, QuadraticBezier>(); BuildDictionary(); DiscontinuityLocations(); AugmentDictionary(); // add edges that are along the square (0,0) -> (1,0) -> (1,1) -> (0,1) while (edge_pattern.Count != 0) // make sure there are no more shapes left to process { Dictionary <QuadraticBezier, QuadraticBezier> .Enumerator iter = edge_pattern.GetEnumerator(); iter.MoveNext(); QuadraticBezier first_edge = iter.Current.Key; QuadraticBezier current_edge = first_edge; SVGBuilder.BeginShape(); do // process every edge in each shape { SVGBuilder.SetEdge(current_edge); QuadraticBezier temp_edge = current_edge; DebugUtility.Log("Cycling:", current_edge.end_UV, current_edge.begin_UV); current_edge = edge_pattern[current_edge]; edge_pattern.Remove(temp_edge); } while (current_edge != first_edge); SVGBuilder.EndShape(); } }