MtnViewJohn wrote:The key would be give each shape the same random number seed so that they would end up exactly the same, other than the symmetry operation...
The random number generator for Context Free is not your standard random number sequence generated from a global random number seed. It is tree-like, passed down from parent to child. This is what allows CFDG files to look roughly the same when you change the resolution.
Adjacent shape replacements in a shape rule always get different random numbers derived from the parent shape's random number. This is done to keep the child shapes from looking the same. But if you override this behavior and give the child shapes the same random number then they will look the same.
The point I was making is that the only way to do symmetry without breaking the CF paradigm is to use the CFDG grammar to generate a "sentence" of squares, circles, and triangles and then post-process the sentence to get the desired symmetry. But this post-processing is a pain in the butt and you can get the exact same result by tweaking the CFDG grammar up front to generate a sentence that has the desired symmetry.
This tweak in the random number hack that I mentioned earlier. Right now Context Free kicks of rendering a CFDG file by taking the shape named in the startshape directive, giving it the identity matrix for its affine transform and pushing it onto the render queue. This first shape has a random number that is derived from the variation code. The hackish way to do mirror symmetry is to put two copies of the startshape onto the render queue, one with the identity matrix and one with the reflection matrix, and both with the same random number.