Aug 302014
The Philosophy of Engineering and the Engineering of Philosophy

A few months ago (this post has been lurking semi-forgotten in my drafts folder for a while) my colleague Richard Boyd posted a piece on our company Arup Thoughts blog advocating a closer relationship between engineering and philosophy, either cunningly or coincidentally timed to coincide with the release of the documentary Ove Arup: The Philosopher Engineer.  As an engineer with an interest in philosophy I found it an interesting article and one that I mostly agree with. One part that I am slightly sceptical about is his closing suggestion that closer ties with philosophy would be a solution to the perceived low status of engineering in the UK.  Philosophy, after all, has its own issues with public perception and for [...]

Aug 252014
SPARTAN v1.0 - Small Pixel Art Animator

SPARTAN (Small Pixel ART ANimator) is a tool I made to create animated sprites.  There are umpteen millionty different programs available to do that same job, however none of the ones I tried really matched the way that I wanted to do things.  So, I decided to write my own, set up in exactly the way that suited me.  Originally this was supposed to be solely for my own use but as time went on I got a bit carried away and accidentally turned it into something that may be useful for other people as well. Features: Draw, Line, Circle, Ellipse, Fill, Select, Move and Pick Colour tools, set up to provide complementary functions on left- and right-click. Hierarchical data [...]

Aug 142014
AADRL 2013/2014 – Extending Rhino+Grasshopper with C# – Session 6: Classes and Physical Simulation

Daniel Piker’s Kangaroo plug-in for Grasshopper allows us to set up and run various kinds of physical simulation within Grasshopper.  Although we will not cover Kangaroo itself on this course, in this session we will look at a way of writing our own Kangaroo-like simulation code, allowing us to write custom simulators should the need arise and also understand how Kangaroo is (probably) working behind the scenes. A full multi-purpose physics engine is probably a bit beyond what we are capable of producing in an hour, so instead we will focus on a specific physical phenomenon – gravitation.  We will produce code that simulates a set of particles, all of which have a gravity-like attraction towards each other. As usual, [...]

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