Voilà beaucoup de changements. The outline cells get placed in proper
order. Conveniently this avoids the problem of adding/removing nested
shapes. I had the outline cells calculate their gradients... But
although calculating, grouping and comparing gradients of the outline
cells is possible, I had another, simpler idea. Instead, take the path
traced by these outline cells and rotate and scale it to some identity
shapes. This method should allow to compare any arbitrary shapes in a
hierarchical structure (which suggets NlogN time). The only problem
seems to be finding a way to determine the axis of symmetry for the
polygons so that they can be rotated correctly.