September 28, 2013
While trying to explain curve parameters to my girlfriend (she was proofreading my previous blog post) we hit upon an apt analogy. Imagine you’re taking a car-trip from home to the nearest
Hooters book-shop. It’s a good half-hour drive which takes you over two local roads and a motorway.
If the shape of the road you travel along equals the shape of a curve, then the curve parameters are analogous to the travel times. If you take this trip once every week, then you travel along the same roads every time. Thus the shape of the curve never changes. However some weeks you run into roadworks or thick fog or a traffic jam and then your travel times start to differ. Some parts of the trip may go faster than usual, others may go slower.
The point is that once you have the entire trip data (i.e. the entire curve data, not just the shape) you can then work out your location at 12:15. And you can work out in what direction you were travelling at 12:15. And you can work out your acceleration at 12:15. And you can work out the centrifugal force you were experiencing due to turning at 12:15. All of these properties can be computed as long as you have the curve (the route) and the correct curve parameter (the time).
It’s now also easy to see that parameters can have different densities in different portions of a curve, and how parameter density can be thought of as the ‘speed’ of a curve.
It even allows us to get a feeling for curve derivatives and why parameterization matters. Derivatives are used to compute the tangency and curvature and torsion of curves. A parallel can be drawn between those properties and the forces that push you into your car-seat due to acceleration. Or the forces that pull you out of your seat sideways because you’re turning too sharply. These forces don’t just depend on the shape of the road, they also depend on your travelling speed.
September 27, 2013
One of the more common misconceptions people have regarding computational geometry has to do with curve parameters. Since the mathematics of Nurbs curves are rather involved —much of it is certainly beyond high-school level— it is quite difficult to explain how control-point coordinates, control-point weights, curve degrees and knot-vectors all conspire to complicate the parameterization of a nurbs curve. My own grip on Nurbs maths is slippery at best so I think it’s better for everyone involved if I start this discussion using much simpler types of curves.
But before we can start talking about the problem, we should first lay down some ground rules for what sort of shapes qualify as ‘curves’:
- A curve is a finite, one-dimensional object, existing in some space with an arbitrary number of dimensions. In this blog post I’ll only concern myself with two-dimensional and three-dimensional spaces as we are all familiar with them.
- Every curve must have exactly two endpoints. No more, no less.
- If the endpoints coincide, the curve is considered to be closed.
- There may be no gaps on the interior of a curve, as that would result in more than two endpoints.
- There may be no branching points on the curve, except where an endpoint is coincident with some interior point of the curve.
Basically, think of all possible curves as liquorice laces, you can stretch, bend, twist and kink them, but ultimately it’s nothing more than a bunch of deformations applied to a straight piece of chewy goop. Note that the definition above differs from the common mathematical definition of curves. Mathematicians tend to be far more inclusive and rigorous.
September 17, 2013
I’ve been thinking about Grasshopper 2.0 for a while now and there are a lot of facets to the project where I’d like to see improvement. One of the things I’m looking into is incorporating 3rd party code libraries that would provide advanced statistical and algorithmic functionality. One of the libraries I’ve been browsing is the Microsoft Solver Foundation whose main purpose is to solve optimization problems.
Looking for examples on how to use MSF I came across this blog post which poses a hypothetical (but not unrealistic) problem which can be cracked using an algorithmic solver. The post itself has some inconsistencies in the numbers it uses to describe the problem, so I’ll outline it briefly here as well:
- You own a trading company and you’re looking to import some cheap-ass furniture from China and sell it to gullible Europeans for cut-throat prices. So the goal here is profit maximization.
- We hire individual containers from a shipping company, and these containers have limits on how much weight you can put in. We’ll use a 500 kilogram limit in this tutorial. We are not concerned with volume limitations.
- There are three types of furniture we can import; chairs, tables and bookcases (the original article uses cupboards instead of bookcases, but I wanted three items that start with different letters). Each has its own specific purchasing cost, profit margin and weight.
- There is one additional constraint concerning purchasing cost; your company can only afford to spend 5000 Euros per container.
That’s it, simple enough. A profit function with three variables (amount of chairs, tables and bookcases respectively) and two hard constraints limiting the weight and purchasing costs.
Because of the weight and purchasing constraints this problem becomes non-trivial and an algorithmic approach would be good to have, if only to check your intuitions in case you’re doing the purchasing by hand.
This is a three-variable problem which means the phase space of all possible states is three-dimensional and the fitness landcape is a four-dimensional surface (if you don’t know what a fitness function/landscape is, please see this blog post or buy the Architectural Design publication with my article). I cannot draw a four-dimensional surface on a two-dimensional screen so instead I decided to just make sh*t up and hope it gets the point across regardless of being utter humbug:
Here you see a two-dimensional phase-space (let’s ignore bookcases for the time being and assume we only have to pick chairs and tables) with the resulting three-dimensional fitness landscape. From left to right we go from zero chairs to some arbitrary upper limit. From front to back we go from zero tables to some arbitrary upper limit. Every two-dimensional point is some combination (i.e. state) of chairs and tables. For every combination we can compute the profit that combination would generate, and this has been represented by the height of the landscape. The higher the surface, the more money we’re going to make. Find the highest point on the landscape and you know how many chairs and tables hit the sweet spot.
So far so good. But what about our constraints? Some combinations of chairs and tables are impossible either because they weigh too much or because they cost too much. So our landscape shouldn’t in fact exist at all when this is the case. This is known as a hard constraint and unfortunately in Galapagos it is impossible to add a hard constraint (at least for now).
Luckily we can mimic this effect with penalty clauses. We’re looking to maximize our profit, so what we’ll do is subtract a large amount of money if any of these constraints are overstepped. As long as we subtract enough, the solver will automatically avoid those areas. Enough theorizing, lets hook up some wires!
August 9, 2013
This is going to be a difficult post to write on several levels. I’m about to lay heavy blame on a number of people and organisations who are part of my loyal customer base. I am also going to incriminate the industry I work for, which includes my direct employer and —of course— myself.
At the same time I have to marshal my arguments very carefully so as not to belittle a specific individual whose work I am about to dissect and critique in a harsh tone. I firmly believe —although he probably doesn’t agree with me— he is the victim of the twin evils of underinformed educators and overeager, heedless software companies. I wish neither to patronise nor scapegoat him and I know that cushioning language is not my strong suit. Please remember this while reading the text below. This is not about ridicule, but rather about a pervasive and alarming world-wide trend in academic architecture.
I’d like to thank ███████████ for sending me his work and having the courage to allow me to publicly critique it, knowing I’d focus only on the bad and not the good.
Also my sincere thanks goes out to K. who —unlike me— did receive proper academic training during her time at University (Turku University, Department of English) and was able to comment comprehensively on the scholarly and academic aspects of this critique.
May 27, 2013
A few days ago our #1 pet started showing signs of depression. It came on quite suddenly, sleeping a lot, loss of appetite, no purring, no grooming, no marking. There seem to be several common causes for cat depression, including a new pet (check), moving to a new place (well, yes, but we haven’t got there yet), changes to the living environment (check, the place has been a mess for weeks since we’re packing) and abandonment (check, with an additional cat in the house and a lot of work to do he’s been getting less attention).
We were getting quite worried about this as there are a lot of other stress factors in his near future and a cat that’s not eating is not long for this world. Today however he seems to be getting better at a rather spiffy rate (asking for food, jumping on window sills, playing with cat #2). From what we know about depression it’s unlikely to start and stop suddenly, unless it’s part of a bi-polar disorder.
But I haven’t watched the first 5 seasons of House* without learning anything and I think we may have found the actual problem. A few days ago we took the cat out into the car so he could get used to the space and the smell. Like the little furry chicken he is he immediately started struggling once it became obvious I wanted him inside the car. However once inside I let him go so he could explore in his own time. His plan of escape was well planned and expertly executed; one massive leap through the open window onto the safe green grass beyond. Unexpected complication was that the window in fact turned out not to be open after all.
It was quite a massive, head-first collision and given the rate at which symptoms occurred and then dissipated a concussion seems more likely. Unfortunately we didn’t think of it early enough to test for anisocoria.
* and yes, season 4 was lame and season 5 was terrible and I stopped watching after that.
May 26, 2013
I haven’t been posting much lately, reason being is that our life has taken a pretty significant turn. Since Christmas last year we’ve been looking for a new place to live. We finally found a nice little house in a quiet part of Tirol that’ll suit the three of us just fine. We have no idea yet how the cat will react to the local wildlife (should be mostly deer, foxes and hares), hopefully nothing untoward will happen.
None of us is a party animal and we’d much prefer to live amongst the trees than amongst the pubs. The place is somewhat on the small side for two people who both work from home, but we’ll make do.
One problem with living far away from centres of commerce is that we will need a car to get around. I don’t have a license yet but luckily K can serve as my chauffeur until I do. The house pretty much tapped all our savings but I think (read: hope) we’ve found something which will last us for the upcoming 5 years. It’s an early C220 CDI kombi model (2001), imported into Slovakia via Italy and owned by a succession of Mercedes dealership employees. We’ll be the fifth —and probably last— owners this car will ever have.
Picture above from our first prolonged test-drive in the local mountains here. We had to pull over as apparently there was a bike race going on. Still, not a bad place to have a break. That’s Hotel Panorama on the ridge above us.
And lastly, we’ve also got a second cat. This wasn’t planned and we’re still hoping to find a new home for her before we drive to Austria next week. She showed up about a month ago on our window sill. Emaciated and scruffy. After a month or so with us she’s perked up a bit, though she is still very kittenish. Extremely social and hug-prone, but also a bit naughty so needs someone with firm hand who won’t shy away from smacking her over the head when she steals food.
After we’ve settled in I think I’ll be happy not having to make any major decision again for at least 3 years.
April 1, 2013
Just a quick post with some of the best digital video art I’ve come across. Heavy focus on geometry, algorithms and abstract imagery. In no particular order: