Sun Jun 12, 2005 9:38 pm by MtnViewMark
Not so fast....
It may surprise you to learn that the implementation of CFDG isn't recursive at all! Honest! The recursive grammars are expanded using a purely iterative function. So, recursion in PostScript isn't the issue.
The real issue is that the infinite recursions in a grammar (which would translate into iterations that never end) only end because we are rendering to a pixel map and we decided to give up when things get to less than 0.3 of a pixel. So, even when rendered with PostScript, the result wouldn't be resolution independent.
There are two possible paths here:
One, we expand on the computer, and generate a large set of PostScript primitives that match what you see on the screen. In this mode, we'd have to ask you what size paper and what resolution printer, and then stop when we hit 0.3 pixel in that environment. Clearly, the result, while could be printed on different printers, would only be optimized for one configuration.
On the other hand, we could translate the grammar into a bit of PostScript and tack on a CFDG PostScript library, and perhaps some code so that one could reliably recreate a particular variation. Then the grammar expansion would be run in the printer. In this case, the expansion would proceed to match the resolution of the printer. The down side of this is that expansions of this sort (say 8 x 10 at 600 dpi) could require tremendous memory for processing that most printers don't have. (Have you ever see Context Free use temporary files? We have images that use 30 files, each at a million shapes!)
Even if either of these solutions is acceptable, there are still a big barrier to PostScript being a useful output medium for Context Free: PostScript interpreters aren't optimized for doing sub-pixel shapes - which is what Context Free almost always ends up with. These shapes only look good if properly anti-aliased. However - PostScript in printers generally doesn't anti-alias structured graphics (Honest!). Hence, it actually wouldn't look as good as rendering on the computer (where we use a library that does sub-pixel rendering and anti-aliasing) and shipping the PNG to the printer.
Some people would like to have output to EPSF so that they could then take the images into Illustrator and manipulate the graphics primitives. But I'm not sure Illustrator could handle 200,000 sub-pixel sized circles, or really how effective one could manipulate such a beast.
Now, despite all this "why we can't do it", I actually like the idea of structured graphics output. I just don't know how to do it so the result is useful yet.
I'm the "m" in "mtree.cfdg"