Sortal grammar interpreter (Grasshopper)   Index


The SortalGI Grasshopper plug-in encapsulates the SortalGI sortal grammar interpreter and makes part of its functionality available within Rhino/Grasshopper.

The SortalGI Grasshopper plug-in supports points, line segments, plane segments, circles, ellipses, (circular) arcs and quadratic Bezier curves, labelled points and descriptions. It supports both parametric and non-parametric rules, and emergence.



Download the SortalGI Grasshopper plug-in: (version 0.4.0)
This is the latest version. The shape (and dShape) component accepts points, text points, lines, polylines, (flat) surfaces, meshes, boundary representations, circles, ellipses, (circular) arcs and/or quadratic Bezier curves. A new pRule component allows for the specification of parametric rules. The matching mechanism for parametric rules uses a combinatorial approach of infinite lines that carry any line segments in the given shape, and uses parallelism and perpendicularity of lines as matching constraints, as well as to whether an intersection points falls inside, outside or is an endpoint of any line segment on each infinite line. A new derive component accepts a list of rule objects and applies each in sequence.

The previous version is still available for download: (version 0.3.1)
This version supports line segments, plane segments, labelled points and descriptions. A dShape component supports the specification of a shape to include descriptions (either as attribute to a 'labelled' point or as separate descriptions). Separate descriptions need to be 'typed' and description types need to be predefined. The Setup component takes description types as an additional input.



The SortalGI Grasshopper plug-in is made available as a .zip file. After unzipping it, you will find a folder containing the following components: a sortal-setup folder, a components folder, a sample folder and a user manual (PDF document).

  • The sortal-setup folder contains a setup batch file and a number of support packages, including the SortalGI (Python) library.
  • The components folder contains the Grasshopper user objects that give access to (part of) the functionality of the SortalGI (Python) sortal grammar interpreter.
  • The sample folder offers a few demonstrations of the use of the SortalGI Grasshopper plug-in.
  • SortalGI plug-in user manual 04 provides information on the plug-in, installation instructions for Windows, explanation on all of the components and their usage, and detailed information on specifying descriptions.

The installation involves two steps. The first step is the installation of the SortalGI library, the second step is the installation of the SortalGI plug-in user objects. These steps are also explained in the SortalGI plug-in user manual 04 instructions.

  1. Execute the setup.bat batch file which can be found in the sortal-setup folder. This will copy the content of the sortal-setup\site-packages folder into the Plug-ins\IronPython\Lib\site-packages folder of your Rhino installation folder. Alternatively, you can do so manually.
  2. Next, add the Plug-ins\IronPython\Lib\site-packages folder of your Rhino installation folder into Rhino's Module Search Paths.
    • Launch Rhino
    • Type EditPythonScript in the Command box
    • In the Rhino Python Editor window, select 'Options...' from the Tools menu
    • Add the Plug-ins\IronPython\Lib\site-packages folder of your Rhino installation folder into the 'Module Search Paths'
    • Select the Script Engine tab, check the 'Frames Enabled' option and click 'OK'.
  3. Open Grasshopper and select the 'User Object Folder', under 'Special Folders', from the File menu. Copy the content of the sgi_components folder into the UserObjects folder.
  4. Exit Rhino and relaunch Rhino. The SortalGI plug-in should now be present as a specific tab in the Grasshopper Components Tab Panel, called 'SGI'.

You are now set to go.



Please refer to the SortalGI plug-in user manual 04 for information on the different components available and their usage.



The demo folder contains a number of grasshopper demonstration files

  • rules 1 shows the creation of two rules using only line segments (the points that are drawn are not part of the respective shape, these serve as reference points). One rule moves a square diagonally and another moves an L-shape diagonally.
  • rules 2 illustrates the concept of emergence. It shows a derivation (Knight, 2003)1 applying the two rules created above, using a series of Apply nodes.

  • rules 3 shows an extended derivation of all possible rule applications over two steps, applying the two rules created above, using two Apply All nodes.

  • inscribed illustrates the use of a point to constrain rule application. It shows a derivation (Stiny, 1985) applying a rule to inscribe a square with a rotated square.

  • froebel illustrates the use of labelled points, descriptions and plane segments in 3D. It shows a derivation (Stiny, 1981) composing a design made up of blocks ('oblongs', 'pillars' and 'squares') from Froebel's building gift 6. The parallel description rules extract information form the shape to provide a description of the design, from which a block-by-block description can be derived. Note that compared to Stiny (1981), the derivation uses fewer rules, because the description rules are able to interact with the parallel shape rules. However, the derivation uses an additional labeled point assigned to each pillar. In a future version we will remove the need for this.

  • illustrates the use of quadratic bezier curves. It shows a derivation (Jowers and Earl, 2011) of a Celtic knotwork.

  • illustrates the specification and application of parametric rules. It shows a derivation (Stiny, 1977) of a Chinese ice-ray lattice from five rules, each splitting a triangle, quadrilateral or pentagon into two polygons from among triangles, quadrilaterals and pentagons. Note that at this point it is hard to ensure a 'nice' ice-ray lattice, because the splitting points are randomly identified on the respective line segments. In a future version we will provide the means to control this better.


  1. T.W. Knight, 2003, Computing with emergence, Environment and Planning B: Planning and Design 30, 125–155.
  2. G. Stiny, 1985, Computing with Form and Meaning in Architecture, Journal of Architectural Education 39(1), 7-19.
  3. G. Stiny, 1981, A note on the description of designs, Environment and Planning B: Planning and Design 8, 257-267.
  4. I. Jowers and C. Earl, 2011, Implementation of curved shape grammars, Environment and Planning B: Planning and Design 38, 616-635.
  5. G. Stiny, 1977, Ice-ray: a note on the generation of Chinese lattice designs, Environment and Planning B: Planning and Design 4(1), 89-98.

Last update: 14 June 2018, webmaster @