About shape grammars
The interpreter project
Create a grammar
Run a grammar
Get out of trouble
The Yingzao fashi project
A design specified by a grammar of two rules.
Open a grammar
- Open the interpreter. Three windows will appear: the main window, the preview window, and the console. To quit, select File / Exit; don’t click on the X in the upper right corner of the window.
- Select File / Open and navigate to the grammar (.dat) file. The grammar will appear in the main window: initial shapes in the upper left, rules below.
Select the initial shape
- Click in the blank space on the right of the initial shape. It will become the current shape and appear in plan view on the current-shape canvas.
- Click on Iso or Tri to see the current shape in a 3D view (isometric or perspective). If it is too large for the canvas, click on Fit. To admire its 3D wonderfulness, adjust the theta and alpha values.
Calculate the next shapes
- Either a)
select one rule and Show unique (one rule); or b) select Show unique (all rules). All the possible next shapes will be displayed in the preview window. If there is no next shape, a message box will appear.
- Select one of the shapes in the preview window by clicking in the blank space on its right. The current-shape canvas will be updated.
- Repeat with the other shapes as much as you like. The shape may be not be completely visible in the preview window, but it will be in the current-shape canvas. If it is too large, click on Fit. The shape displayed on the current-shape canvas is the current shape, and will be the basis of the next rule application.
- Repeat steps 1–3 until you are satisfied or until no next shape is possible.
Change your mind
- Select Go backward or Go forward to undo and redo rule applications.
Export the derivation and current shape to Rhino
- Select Derivation > Save derivation. A Save as dialog box will appear.
- Enter the name of the derivation (e.g., ‘test’). The system will add the suffix ‘drv’.
- Switch to Rhino.
- Select Tools > PythonScript > Run… from the menu bar. An Open file dialog box will appear.
- Run the ‘import_derivation’ script. The derivation, from initial shape to final shape, will be drawn in Rhino. If you want just the final shape, run the ‘import_final_shape’ script.
i (at) andrew (dot) li