|
Home
About me
About shape grammars
Publications
The interpreter project
Set up
Create a grammar
Run a grammar
The Yingzao fashi project
|
A fractal specified by a grammar of two rules.
Creating a grammar comes down to creating shapes and rules. Here’s how.
Create a shape
First, draw a shape in Rhino.
- Draw a shape. You can use straight lines and annotation dots (i.e., labeled points). You can use a script (as I did in the video). You can probably use Grasshopper, although I haven’t tried it.
- Select Tools > PythonScript > Run… from the menu bar. An Run Python script dialog box will appear.
- Select shape_exporter.py. A prompt will appear on the command line.
- Select the lines and labeled points. A prompt will appear.
- Enter the name of the shape (e.g., test). A Save shape as dialog box will appear. The shape name will be suggested as the file name (e.g., test.is).
Then, switch to the grammar environment and import the shape.
- Select Initial shape > Import initial shape from file… from the menu. An Open dialog box will appear.
- Select the shape file (e.g., test.is). It will appear (in plan view) in the initial shape list.
- Select File > Save as… from the menu. A Save as dialog box will appear. (For some reason that I’ve forgotten, Save doesn’t work for a new file. Once a file has a name, Save works as expected.)
Create a rule
Say you want to create a rule A → B. Then you need to draw the shape C that contains every element in A, in B, or in both. (I did this in the video too.)
First, draw the shape C in Rhino.
- Draw the shape as above.
- Select Tools > PythonScript > Run… from the menu bar. An Open file dialog box will appear.
- Select rule_exporter.py. A prompt will appear.
- Select the lines and labeled points in A. A prompt will appear.
- Enter the name of A. A prompt will appear.
- Select the lines and labeled points in B. A prompt will appear.
- Enter the name of B. A prompt will appear.
- Enter the name of the rule (e.g., test). A Save rule as dialog box will appear. The rule name will be suggested as the file name (e.g., test.rul).
Then, switch to the environment and import the rule.
- Select Rule > Import a rule… from the menu. An Open dialog box will appear.
- Select the rule file (e.g., test.rul). It will appear (in plan view) in the rule list.
- Select File > Save from the menu. (I’m assuming that you’ve already done a Save as.)
If you find this hard to follow, try the manual or the video.
|
Contact me
i (at) andrew (dot) li
|