About shape grammars
The interpreter project
Create a grammar
Run a grammar
Get out of trouble
The Yingzao fashi project
Above: A grammar to generate Sierpiński gaskets. It consists of an initial shape (back left) and two rules (front right, with arrows). Below: A Sierpiński gasket, generated by the same grammar.
- Make sure you have Rhino and Windows installed. Use a version of Rhino that can run Python scripts (Rhino v5.8 (or later) for Windows, apparently). To see the version number, in Rhino select Help / About Rhinoceros. Look in the lower right corner, in parentheses.
- Download the interpreter package (called ‘interpreter-package’). It contains these items:
- The grammar environment (also called the interpreter).
- A folder called ‘package’ containing the translator scripts.
- Other items, such as documentation and sample grammars.
- Check the path names of the interpreter folder and the scripts folder. All names in the path(s) to these two folders must consist only of ASCII characters. Put simply, this means that the parent folder of either or both of these two folders must have an English name. This also applies to the grandparent folder, the great-grandparent folder, and so on up to the root. Don’t use names like ‘文法’ or ‘グラマー’ or even ‘grámmar’ (which has a letter with an accent). Use only the English input method; with other methods you can input English letters, but they may not have the ASCII codes.
- Set the Python module search path. In Rhino, open the Python script editor (Tools / PythonScript / Edit). In the Python script editor, select Tools / Options / Files. Press ‘+’ and navigate to the folder containing the folder ‘package’. (This is the folder ‘interpreter-package’, unless you changed the name.) Restart Rhino.
If you’re hot to trot, now is a good time. If, on the other hand, you’d like to read some more instructions, go to the next page.
i (at) andrew (dot) li