One line of code and you have it!
Weird? Cool? Wizardry?
What’s a gömböc, anyway?
Wikipedia defines it as:
The gömböc is a convex three-dimensional homogeneous body that when resting on a flat surface has just one stable and one unstable point of equilibrium.
That was probably written by mathematicians, I’ll try to describe it in a simpler way.
It’s an object that is self-righting due to its shape.
Let’s compare it to a weeble toy, probably a better known self-righting object. The weeble comes back to the resting position because it has something heavier than the rest of the body in its bottom. So it relies on different densities to perform its trick. A gömböc body instead has the same density everywhere, so it relies on its shape to come back to the equilibrium point.
The definition says it has two points of equilibrium, one stable and one unstable. That means it will always come back to the same position because even though formally it has another equilibrium point, this one is unstable. It would be like trying to have a pencil standing on its tip, theoretically possible, but unlikely in practice because any perturbation would knock it down.
On the internet I’ve found an interesting read about the story of the gömboc and that something similar can be found in nature, on turtles.
By now you’re probably saying: Ok, got it. Well, you started this by saying it took you one line of code to model, can you share it then?
Sure
(morph (sphere 1) (extrude (rectangle [-0.01 -1.2] [0.01 1.2]) 0.25 1.1) 0.2)
Needless to say it is a bit of a joke with the fact that we are in 2020 and some people still measure productivity using lines of code (LOC) as metric.
I have two things to say about this, First that we need to always ask ourselves if we are using the right tool for the job, second that we are always hiding complexity in libraries.
I modeled this using libfive. It is a fantastic piece of software that uses f-rep to model solids. I love that it uses Scheme ( a subset of Lisp ) for high level scripting. It’s really amazing the way Lisp enables you to easily create complexity by adding layers of lesser complexity. Very powerful.
This is the kind of computing that makes computers fun, playful, interesting and sometimes disturbing things that they are.
Thank you for reading,
Edi