SortalGI Shape Grammar Interpreter
(by stouffs)
The SortalGI shape grammar interpreter supports the specification and application of parametric and non-parametric shape rules.
Support Email

The SortalGI Grasshopper plug-in encapsulates the SortalGI shape grammar interpreter and makes part of its functionality available within Grasshopper. It supports the specification and application of both parametric and non-parametric shape rules and the generation of single or multiple (in parallel or sequence) rule application results. The SortalGI Grasshopper plug-in supports points, line segments, plane segments, circles, ellipes, (circular) arcs and quadratic bezier curves, labelled points and descriptions, in 2D or 3D. Emergence is naturally supported.


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 PDF user manual.

  • 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 offers demonstrations of the use of the SortalGI Grasshopper plug-in.
  • "SortalGI plug-in user manual 09.pdf" 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 three steps. The first, preparatory step only needs to be done once, and only on Windows. The second step is to install the SortalGI library in a place where Rhino can find it. The third step is to install the SortalGI plug-in (user objects) for Grasshopper. These steps are also explained in the "SortalGI plug-in user manual 09.pdf".

Step 1a [Windows]: Installing GhPython -- In case of Rhino 5 (Windows only), make sure to download the GhPython Grasshopper Assembly file (gha) from Food4Rhino, choose File > Special Folders > Components folder in Grasshopper and save the gha file in this folder.

Step 1b [Windows]: Updating Rhino’s Module Search Paths -- Add the Plug-ins\IronPython\Lib\site-packages folder of your Rhino installation folder into Rhino's Module Search Paths and enable 'Frames'.

  • Open 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'
  • Close Rhino completely

Step 2 [Windows]: Installing the SortalGI library -- Copy-paste the content of the lib folder (i.e., the folders sortal and site-packages) into the location C:\Program Files\Rhino 6\Plug-ins\IronPython\Lib or equivalent on your computer. Note:

  • There may already be a site-packages folder in IronPython\Lib, it suffices to add the content of site-packages to this folder
  • Adding files to the target folder may require admin access. If you do not have admin access, you can choose a different location to hold these files. You must then add the appropriate module search paths in the following step.

Step 2 [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. Note:

  • The Library folder may not be visible. If so, select your home directory in the finder, choose 'Show view options' from the View menu and check 'Show Library Folder'.
  • You cannot choose a different location to hold these files. Rhino 6 for Mac does not (yet) support module search paths.

Step 3 [Windows/Mac]: Installing the SortalGI plug-in.

  • Open Rhino and Grasshopper
  • In Grasshopper, choose File > Special Folders > User Objects folder
  • Copy-paste the content of the user objects folder into this UserObjects 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.


The samples folder contains a number of demonstrations of the use of SortalGI within Rhino and Grasshopper

  1. 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.
  2. step-by-step shows the emergence example in a step-by-step elaboration. Each step is contained in a different gh file.
  3. inscribed square llustrates 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.
  4. 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.
  5. curves illustrates the use of quadratic bezier curves. It shows a derivation (Jowers and Earl, 2011) of a Celtic knotwork.
  6. 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'.
  7. 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.
  8. flow example illustrates the use of flows as composite rules embedding the algorithmic patterns of sequence, selection and/or iteration. This particular example illustrates a collection of three rules, the first one activating squares, the second one constraining the activation of squares such that these are not adjacent, and the third one applies a transformation rule to the activated squares replacing them with triangles. The flow application generates all possible outcomes. The entire flow is written as '(activate_rule{2} !constrain_rule) triangle rule{2}'.