Cocoon by David Stasiuk is an add-on to McNeel’s Grasshopper visual scripting interface for Rhinoceros. Cocoon is a fairly straightforward implementation of the Marching Cubes algorithm for turning iso-surfaces into polygonal meshes. It is geared specifically toward wrapping existing geometric elements, and works with combinations of points, breps and curves, allowing users to vary a number of parameters that enhance sculptural potentials.
Cocoon reworks an earlier script, the Geometry Wrapper. Like this earlier one, it is based on the marching cubes and implicit surface posts by Paul Bourke on his website. The lookup tables are directly lifted from his script, and the metaball calculations used here are directly pulled from his page. The first difference between Cocoon and the earlier script is that Cocoon breaks out geometry charges into individual components, which hopefully will make it easier to manage and control a variety of inputs.
The second difference is that Cocoon also separates the radius of influence and strength of each charge into two parameters. This not only allows for slightly more nuanced control over how each charge behaves, but it also enables negative charges. The next is that curve charges can be dynamically varied with much greater control.