


The Medial axis or Voronoi Skeleton of a polygon is the set of all the points with 2 or more closest points on the polygon’s boundary. Another way of putting this is that it is the locus of the centre of all the maximal inscribed circles.

It is an important tool in computational geometry, with a wide variety of applications, from image recognition to finite element analysis. The closely related straight skeleton has also been used for generating ridge-lines for the rooves of buildings.
Here is a simple Grasshopper definition for generating the medial axis of an arbitrary 2d closed curve.
As I have written about earlier, this also generalises nicely to 3D

October 5, 2009 at 1:36 pm
Around 1990, when I was in my first year of Mechanical Engineering school, I spent some time toying around with an algorithm to solve the roof construction problem, of which we did quite a few by hand in our Technical Drawing classes. The feat then amply surpassed by programming ability, so I never got anywhere. But I seem to recall I got the wrong idea that the solution may not be unique. It’s anyway comforting to know that I was six years ahead of my time… ;)
October 6, 2009 at 3:32 am
thanks for posting. i click “here” to download, somehow it only saves as xml file, or i type .ghx, doesn’t seem to work neither.
thanks
October 6, 2009 at 1:37 pm
Try downloading it from the grasshopper site:
http://www.grasshopper3d.com/profiles/blogs/medial-axes
October 7, 2009 at 4:07 pm
Nice one, I’ve been wondering how to generate solids like the monkey & shark from outlines. You always have such original geometric investigations. :)
October 7, 2009 at 5:18 pm
Thanks. The monkey and shark solids were made by a union of cones centred on the medial axis with their height and radius given by the shortest distance to the boundary.
I think their surfaces are actually developable, which might be useful for fabrication.
October 9, 2009 at 2:42 am
This reminds me of a TED talk I watched by Robert Lang where he wrote a program to generate the base nets for very intricate origami creations by drawing a stick figure in the software.
October 12, 2009 at 5:57 am
hi daniel,
thanks, it works now fromt the grasshopper blog download… i have another question, i see a gh skeletion inside the closed curve i drew in rhino, however there is another rectangle boundary inscribing the closed curve and skeletion? is that ur intention? the skeletion and rectangle are in one object, not seperated…
thanks
October 12, 2009 at 10:13 am
Thanks Peter. Robert Lang’s origami work is really amazing stuff.
Herman – Yes the definition also makes the exterior skeleton (so it works for non-closed curves too).
The rectangle is just the bounding box, which you can set to whatever size you like.
It is easy enough to cull the exterior skeleton if you just want the interior one. GH doesn’t currently have a 2d ‘inside polygon’ test, but you can just extrude the boundary and test which curves are inside the resulting Brep.
October 15, 2009 at 8:25 am
thanks for the explanations!
January 5, 2010 at 12:55 am
Nice stuff. I remember reading some of Blum’s stuff some years ago and getting really inspired by it!
February 16, 2010 at 11:37 am
Daniel, I edited your definition a bit to make a version that works with multiple curve inputs for some pseudo-historical speculation. Thought it was only proper to share it
April 13, 2010 at 9:45 am
I’ve modified this definition to work with interior ‘islands’
check the ghx here
November 17, 2011 at 5:17 pm
[…] of the first grasshopper definitions shared at Daniel Piker‘s SpaceSymmetryStructure blog was a file for calculating the medial axis -or topological skeleton- of a curve: the set of […]
July 14, 2015 at 2:15 pm
[…] logic of this script using Voronoi cells to find the “medial axis” is explained on the Space Symmetry Syntax blog by Daniel Piker, but here the definition is reworked to work with the latest versions of […]