Sortal grammar interpreter (Python)   Index


The Python SortalGI sortal grammar interpreter library and API has been developed in the Python programming language and can be used within the Rhino 3D modeling environment.

The SortalGI sortal grammar interpreter supports both parametric and non-parametric shape grammars, including line segments, plane segments, points, (non-parametric) circular and elliptical arcs, labels, weights, colors, enumeratives, and (parametric) descriptions, in 2D and 3D. Emergence is naturally supported.

The API developed for the Rhino 3D modeling environment currently limits the use to non-parametric points and line segments, optionally augmented with labels and/or weights. However, all functionality within the SortalGI library is available directly from the library.



Download the SortalGI library: (version 0.171120)



The SortalGI library is made available as a .zip file. After unzipping it, you will find a folder including, among others, the following components: a sortal-setup folder, a sortalgi folder, a documentation folder, and a demo scripts folder.

  • The sortal-setup folder contains a setup batch file and a number of support packages, including the SortalGI library.
  • The sortalgi folder contains the application programming interface (API) to access the library from within Rhino, organized into two components:
    • The file defines all base methods within the API: setting up the sortal library, creating a rule, finding rule applications, 'maximalizing' a shape, determining whether one shape is part of another, retrieving information about a rule and overwriting this information. These methods adopt an agnostic shape description that lies between the Rhino-specific representation and the SortalGI representation for shapes.
    • The sortal_lib_api subfolder contains all supporting methods.
  • The documentation folder contains installation instructions, API documentation and an explanation of the provided demonstration for Rhino.
  • The demo scripts folder contains a python demo sub-folder for use with the Spyder Python development environment within Ananconda, and a rhino demo sub-folder for use with Rhino. The latter contains all demonstration support files, including the Rhino specific part of the API that is used within the demo.
    • The sortalgi folder mirrors the sortalgi folder in the parent folder and additionally duplicates the SortalGI library.
    • The convert folder includes methods to convert Rhino objects identified by their GUIDs into agnostic shape descriptions.
    • The rhino_specific subfolder offers methods for displaying agnostic shapes within the Rhino canvas.
    • The setup subfolder contains various setup and interface code that is largely based on Andrew Li’s shape grammar interpreter.

Last update: 1 December 2017, webmaster @