Jun 242014
 
AADRL 2013/2014 – Extending Rhino+Grasshopper with C# – Session 5: Fractal Branching & Recursion

Everything that we have covered so far could have been achieved, with perhaps a little more hard work and head-scratching, using grasshopper without scripting. However there are certain kinds of algorithm that cannot be achieved within native grasshopper without the use of scripting or specialist plug-ins. Perhaps the most prominent category of these algorithms are those which rely on recursion in order to generate forms with self-similarity such as fractals, L-systems and so on. In computer science, ‘recursion’ is a term used to refer to functions whose definition includes a call to itself. For example: (Whatever you do, don’t try to actually run this snippet – this is an example of infinite recursion and it will keep going ‘forever’ – [...]

Jun 052014
 
AADRL 2013/2014 – Extending Rhino+Grasshopper with C# – Session 4: Generating A Randomised Surface

In this session, we will be examining how to build up a custom surface from scratch in C#.  We will first generate a grid of points with randomised z-coordinates.  We will then create curves that pass through columns of those points and eventually loft between these curves to create a surface. To begin with, create a new C# component and set up three inputs.  These will be called ‘x’, ‘y’ and ‘s’ and should all have their type hint set to ‘int’.  The x and y inputs will be used to control the number of points in the grid in the x and y directions.  The s input will provide a seed value for our random number generator – more [...]

May 142014
 
AADRL 2013/2014 – Extending Rhino+Grasshopper with C# – Session 3: Curves - parameterisation, division and creation

Example 3B: Dividing and Constructing Curves In the previous example we used a standard Divide Curve component to obtain evenly spaced points along our input curves.  However, for the sake of completeness and also to demonstrate the way that curves can be manipulated in code, let us now modify our script so that this part of the definition is also done by our script. So, from the end point of the last example, delete the Divide Curve components and plug the input curves directly into our script component’s x and y parameters.  You will need to edit x and y so that they use Item Access rather than List Access (since we are now only putting in one thing to [...]

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. (7DArrrL.zip – 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
 
7DArrrL

(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 [...]