Mar 262014
AADRL 2013/2014 – Extending Rhino+Grasshopper with C# – Session 2: If Statements and Loops

Example 2B: Switching between two points, If statements In the last session, we created our own version of the built-in line component.  Now let’s take that previous example and move it a bit beyond what we could have just done with the standard component.  Let’s make it so that the component is smart, and that if we give it a choice between two end points it will pick the one which is closest to the start. Add a new point to the Rhino document and a new Point parameter in grasshopper that references it.  Now zoom in on the C# component until the tiny + and – symbols appear.  Click on a ‘+’ to add a new input parameter. Name [...]

Mar 192014
7DArrrL version 0.1.2 - Post-challenge bug-fix release

I’ve made some minor post-challenge tweaks and bugfixes to 7DArrrL, thus making the name even less accurate.  This new version fixes a couple of mistakes I made in my sleep deprived state and polishes off a couple of minor features that I didn’t have time to quite finish.  There are no major new content additions however and it’s basically the same as the same as the 7-day version with a little bit more love and care lavished on it.  Stay tuned, however, to possibly see it morph into a proper game one day. ( – 7.85Mb – Requires Java) Changes: – Fixed bug where AI ships south of you will mistakenly head away from you rather than towards you (remember [...]

Mar 162014

(Note: I’ve since released a post-challenge bug-fix version of the game, which you can download here.  I’ve left the download below active for people who are particularly interested in seeing the 7-day version.) 7DArrrL is this year’s attempt at the 7DRL challenge.  It’s a semi-success; I didn’t have time to put in everything I wanted to (my initial plans were massively over-ambitious, I realised about half-way in) but it’s still a playable game, even if only as a high-score challenge/demo of the combat system.  Unfortunately the bits I didn’t get around to doing are mostly the bits that would have made it more of an actual Roguelike.  I quite like what I’ve got so far, though, so I will probably [...]

Feb 272014
AADRL 2013/2014 - Extending Rhino+Grasshopper with C# - Session 1: Introduction to scripting

Grasshopper in its natural state is a very powerful tool capable of many impressive feats.  However, due to the way in which it operates there are some kinds of algorithms than are not possible to fully reproduce using its component-based system that would be trivial to implement in a traditional programming language.  Although it contains a vast array of components there are still some areas in which it is lacking in functionality and it can therefore be necessary to extend it by writing new components yourself.  Also, there are often things which, while possible, require long strings of components to achieve what might be more simply implemented as just a few lines of code.   C# In the examples given [...]

Feb 122014
AADRL 2013 - Algorithmic and Production Skills with Rhino + Grasshopper - Session 8: Genetic Algorithms

In this session we will be looking at some more advanced components and methods of using grasshopper, principally focussing on Galapagos, Grasshopper’s built-in genetic algrithm solver.  Along the way, we’ll also be examining Grasshopper’s metaball component and means of flow control – the Grasshopper equivalent of ‘if statements’ in coding. Example 7: Galapagos Galapagos is best used to solve problems to which the optimal solution is not immediately obvious. In this example the problem which we are going to try and solve is to examine a field of points and attempt to enclose as many of those points as possible within a closed curve of a fixed maximum length. If you want a physical analog – imagine that each point [...]

Dec 042013
AADRL 2013 - Algorithmic and production skills with Rhino + Grasshopper: Session 7: Attractor Points

Last session, we started to look at Data Trees and saw how they are structured and how they are formed.  In this session, we will look at why Data Trees exist and what kinds of things they are useful for. Example 6: Attractor Points Attractor points are a useful technique when you want a particular quality to change with distance from a set of control points.  To demonstrate their use we will look at a simple example – dividing up a surface and then controling the scale of the resultant panels with a set of attractor points. First, we’ll need a surface to work from.  In Rhino, draw a surface using the SrfPt command (or any other means of creating [...]

Nov 272013
AADRL 2013 - Algorithmic and production skills with Rhino + Grasshopper: Session 6: Data Trees and Clusters

Example 5: Data trees In this example, we’ll be taking a look at Data Trees.  Data Trees are the key to getting the most out of Grasshopper, but are widely considered to be the ‘hard bit’ and are certainly one of the parts which are least intuitively obvious and take the most getting used to.  Don’t panic, though – they are not really as complicated as they first appear and while it can sometimes take a little trial and error to get the results you want from them, Grasshopper is the kind of environment that renders that kind of experimentation relatively easy. In previous sessions, we have used components that take in a single object as an input and then [...]

Nov 182013
AADRL 2013 Algorithmic and production skills with Rhino + Grasshopper Session 5: Using mathematical functions

Example 3A In the last example, we used a Range component to gradually increase the rotation of a set of rectangular section curves as they moved along a shape, thus creating a twist.  In that case, we increased the rotation linearly (i.e. with the same step each time).  If we were to plot that onto a graph we would get some kind of straight line graph of the form y = mx. We don’t always want to increase things linearly, however.  Say we want to define some other kind of relationship – how are we to do it? One easy way of doing this graphically is with a Graph Mapper component (Params/Input).  Starting from Example 3, drop one onto the [...]

Nov 112013
AADRL 2013 – Algorithmic and production skills with Rhino + Grasshopper – Session 4: List manipulation

Last week, we looked at the basic data-matching behaviour of grasshopper.  In this example, we will see how this behaviour can be manipulated to change certain parameters throughout a collection of objects. Example 3 – Twisted Cuboid First, draw a curve inside Rhino: Curves can be referenced in Grasshopper in exactly the same that Points were in Example 1, only this time we use a Curve parameter component instead.  Add one to the canvas (from the ‘Params’ tab, ‘Geometry’ group) and use it to reference the curve we just created (right click, ‘Set one Curve’).  Now add a Perp Frames component (‘Curve’/’Division’) next to it and connect the Curve output into the C input of the Perp Frames component.  The [...]

Nov 012013
AADRL 2013 – Algorithmic and production skills with Rhino + Grasshopper – Session 3: Data matching with lists

In the last session, we saw how to set up a simple parametric definition to create a piped line.  One of the primary benefits of setting up a parametric model is being able to change input values and have those changes automatically propagate through the rest of the model.  Another significant benefit is being able to handle repetitive tasks by performing the same set of operations over and over again using the same definition.  This session we will look at how Grasshopper achieves this. To demonstrate the key behaviour, we will use the example from last time and see how, without modifying the basic definition, we can handle multiple inputs.  Open last week’s example.  In Rhino, use the Point command [...]