Many of the examples posted on this website make use of SpatialSlur – an open source library of geometric data structures and algorithms that underpin a wide range of generative design strategies. Find it on GitHub here.
SpatialSlur is written in C# and compiled against .NET framework 4.5. While it is mainly used within Rhino/Grasshopper, all Rhino dependencies are compiled separately so the core library can be easily used within other .NET compatible environments such as Unity* or Revit/Dynamo.
* When it updates to .NET 4.5 in the (hopefully) not too distant future
Below is a brief outline of the library by namespace. For further detail, take a look at the reference documentation in the latest release or, better yet, dive into GitHub repo and poke around. Also, feel free to send an email if you have specific questions, comments, or suggestions.
Basic data types and general utility methods
Various generic data structures for spatial queries
Directed and undirected graph implementations including related graph search algorithms
Generic data structures and parallel algorithms for processing discrete fields on regular grids and polygon meshes
Half-edge mesh implementation including various topological operators, subdivision operators, and numerical methods for dynamic relaxation
To get started, either download the latest compiled binaries or fork the GitHub repo and compile on your own machine. SpatialSlur targets .NET Framework 4.5 so you’ll need Visual Studio 2012 or later for the second option.
To use within Grasshopper, right click on a C#/VB component and go to “Manage Assemblies”. Add SpatialSlur.dll and SlurRhino.dll* to the list of referenced assemblies and click “Ok” to confirm. You should now be able to access all classes within that C#/VB component.
Note that the compiled binaries may be blocked by default if downloaded directly. To unblock, right click the file, open up the Properties window, and click “Unblock”.
*Does not apply to 0.1.4 or earlier