29 April 2013

Todays result: Filtering cellular patterns

I have implemented some rough and ready ways to cull the thousands of cellular pattern permutations down to a few for further use.The cellular patterns are the structures I am using to fill the slices of my pink panther woman print. 
The algorithm that generates the patterns uses a seed value that is arbitrary and will therefore generate limitless numbers of  patterns. In reality there are actually few interesting patterns. The algorithm is actually generating the same patterns with different transformations.
A pattern can be transformed back to every other member of its family set by translations, rotations, and scaling. I have defined a length function that 'measures' a pattern. Each pattern can be reduced to a minimum length and patterns are members of the same family if they can be reduced to the same minimum pattern. More than one pattern in a family is redundant. This is analogous to the set of multiples for prime number. Typically its the actual prime number that is important.

After minimising, several instances of the same pattern may continue to appear different because varying floating point numbers. In this case the exact position of vertices of a pattern are not important, instead the relative order of vertices along each axis is meaningful. To homogenise patterns the integer order of each vertex along the X,Y and Z axises is substituted for its coordinates. Patterns can then be compared and duplicates identified. Eg the set of points [0.1, 0.7, 0.5] [0.4, 0.8, 0.2] and [0.6, 0.3, 0.9] would become [1, 2, 2] [2, 3, 1] and [3, 1, 3] respectively.