Medial Axis

medial axes

The medial axes and vanes of various shapes

One 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 points with at least two closest points on a curve boundary. This definition was more accurately a voronoi skeleton, because it is composed from the edges of a voronoi diagram generated by subdivision of the boundary curve. At low resolutions this creates a jagged axis, but fewer segments.

Unfortunately, new releases of Grasshopper have made the original definition unusable (changes to the datastructure of intersection results have made the boolean pattern used to select the interior segments ineffective). This definition follows the same basic algorithm: check the segments of each voronoi cell for intersection; the segments with no intersection are either wholly on the interior or exterior; those on the interior compose the voronoi skeleton. Moving these steps inside a VB.NET script allows us to bypass many of the dataTree headaches. In addition, I’ve added a second output, the vanes extending from the axis to the perimeter, and removed the duplicate segments from the output.

Grasshopper definition canvas

Grasshopper definition canvas

(gh download)
UPDATE: per request a version which can compute the medial axis for shapes of Genus>0. The islands must be located in the same datapaths as the boundary curves and the Voronoi diagrams: (gh download)

Comments
4 Responses to “Medial Axis”
  1. ShynnSup says:

    I think both links are broken, can you please check and see if they can be fixed? The files seem to have been move from the dropbox. Right clicking and saving link dowloads and empty file.

  2. Leah says:

    Hey! The link to this didn’t work – any chance you could repost?

    Thanks!

  3. trevor.patt says:

    Links are updated.

Trackbacks
Check out what others are saying...
  1. […] polygon’s straight skeleton resembles the voronoi skeleton or medial axis, but is composed of only straight segments (and typically fewer of them, a voronoi […]



Leave a comment