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, labels, graytones, colors and descriptions. It supports both parametric-associative and non-parametric rules, and emergence.



Download the SortalGI Grasshopper plug-in: (version 1.6.0)
This is the latest version, working with Rhino 6 and 7. It fixes a bug that impeded some examples using predicates and directives to work in Rhino 7.



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 lib folder, a user objects folder, a samples folder and a user manual (PDF document).

  • The lib folder contains all Python support packages, including the SortalGI (Python) library.
  • The user objects folder contains the Grasshopper user objects that give access to (part of) the functionality of the SortalGI (Python) sortal grammar interpreter.
  • The samples folder offer demonstrations of the use of the SortalGI Grasshopper plug-in.
  • SortalGI plug-in user manual 16 provides information on the plug-in, installation instructions, explanation on all of the components and their usage, and detailed information on specifying descriptions.

The installation involves two steps. The first step is to install the SortalGI library in a place where Rhino can find it. The second step is to install the SortalGI plug-in (user objects) for Grasshopper. These steps are fully explained in the SortalGI plug-in user manual 16 instructions. They are summarized here for Rhino 6:

  • Step 1 [Windows]: Installing the SortalGI library -- Copy-paste the content of the lib folder (i.e., the subfolders sortal and site-packages) into the location C:\Users\me\AppData\Roaming\McNeel\Rhinoceros\6.0\scripts or C:\Program Files\Rhino 6\Plug-ins\IronPython\Lib or equivalent on your computer. Next:
    • Open Rhino
    • Type EditPythonScript in the Command box
    • In the Rhino Python Editor window, select 'Options...' from the Tools menu
    • Add the 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'
    • Close Rhino completely
  • Step 1 [Mac]: Installing the SortalGI library -- Copy-paste the content of the lib folder (i.e., the folders sortal and site-packages) into the location Macintosh HD/Users/me/Library/Application Support/McNeel/Rhinoceros/6.0/scripts or equivalent on your computer. Unpack site-packages by moving its content to the scripts folder.
  • Step 2 [Windows/Mac]: Installing the SortalGI plug-in.
    • Open Rhino and Grasshopper
    • In Grasshopper, choose File > Special Folders > User Object folder
    • Copy-paste the content of the user objects folder into this User Object folder
    • 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 16 for information on the different components available and their usage.



The samples folder contains a number of demonstrations of the use of SortalGI within Rhino and Grasshopper. Some are shown here below, others as part of the gallery. There are also some tutorials available in video form (note that these have not yet been updated from version 1.4.0).

  • emergence illustrates the concept of emergence with 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. It shows a derivation (Knight, 2003)1 applying the two rules, using a series of Apply nodes. It also shows an extended derivation of all possible rule applications over two steps, applying the two rules created above, using two Apply All nodes.

  • step-by-step shows the emergence example in a step-by-step elaboration. Each step is contained in a different gh file.
  • inscribed square illustrates the use of a point to constrain rule application, as well as the use of graytones as attributes to spatial elements. It shows a derivation (Stiny, 1985) applying a rule to inscribe a square with a rotated square, alternating the color between black and white.

  • froebel blocks 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.

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

  • ice ray grammar illustrates the specification and application of parametric-associative 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. This is work in progress. randomly assigns the slitting points on the respective line segments. As such, it is hard to ensure a 'nice' ice-ray lattice. shows how with the use of predicates (shortest-line) and directives (point-on-line) one is able to split a quadrilateral more 'nicely'.

  • massing illustrates the specification and application of parametric-associative rules using descriptions, predicates and directives. It determines all void quadrilaterals (plots) in a figure, scales each quad (footprint) a given distance (border), extrudes each quad by a factor dependent on the ratio of the new area wrt the original area (gfa for a given plot ratio) and adds a surface to each face (facade and roof). A variant of this approach determines a rectangular block within the quadrilateral plot before extrusion.

  • flow example illustrates the specification and application of a flow as a composite rule embedding algorithmic patterns of sequence and iteration. The example includes three rules, where he first rule activates any square, but the second rule constrains activation such that never two adjacent sqyuares are both activated. Finally, the third rule replaces the square with a triangle. All possible outcomes are generated. The entire flow is written as '(activate_rule{2} !constrain_rule) triangle rule{2}'


  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: 4 July 2021, webmaster @