Plankton

Plankton is a free and open library implementing the half-edge data structure for polygon meshes.

This way of storing the mesh connectivity information allows easier adjacency queries and supports mesh faces with any number of sides (Ngons), not just quads and triangles.

The plankton library is intended primarily to be referenced and used from scripts, but  basic GH components for conversion and topology extraction are provided, and more may be added at a future date.

Plankton is still very much a work in progress. This is a first release, and methods/features will change in future versions.

Currently most of the methods relate to extracting topology information from existing meshes, and converting between Rhino meshes and Plankton meshes, but the intent is to over time add more ways of actually modifying and building meshes.

Please share your thoughts and ideas in the forum...

download the latest release here:

https://github.com/meshmash/Plankton/releases/latest

This library is distributed under the terms of the GNU Lesser General Public License (LGPL).

(The source is available on GitHub here)

Copyright 2013 Daniel Piker and Will Pearson

For more on half-edges, see:

http://www.flipcode.com/archives/The_Half-Edge_Data_Structure.shtml

http://openmesh.org/Documentation/OpenMesh-2.0-Documentation/mesh_hds.html

http://www.graphics.rwth-aachen.de/media/papers/directed.pdf

Thanks to the people I have had many conversations about meshes with over the last few years that have really helped inspire and inform this work: including: Daniel Hambleton, John Harding, Kristoffer Josefsson, Harri Lewis, Giulio Piacentino, and especially Dave Stasiuk, who also shared code that helped get this working.

  • patric guenther

    my gh version (0.9.0056, rhino 5 64bit) can not load the plugin. .gha and dll. are unblocked.

    any idea?

  • Daniel Piker

    Patric - do you have more than one copy of the dll ? (ie one in your download folder and one in your GH libraries folder)

    Do you get any errors, or it just doesn't show up on loading ?

  • taz

    Was the name "Sea Monkeys" already taken?  Kidding...

    Looks like interesting stuff, but a bit beyond my level of comprehension.  Hopefully there wont be a quiz anytime soon.

    Cheers,

    taz

  • patric guenther

    @daniel: you were right, there was a copy of the .ddl file somewhere on my drive. now it works fine! thank you!

  • Daniel Hambleton

    Excited to try this out! How much GH/Rhino specific code is the .dll? Would be fun to use it in Unity!

  • Christian Schmidts

    cool tool!  its truly amazing how far you guys brought meshes in gh!

    one question and tree suggestions.

    the question is why inputting a for instance the plankton dual (c#) to the plankton deconstruct fails? i guess its due to the wip state of the tool.

    its also would be nice if there would be a way to convert closed polylines to plankton mesh.

    and another suggestion is to get the faces directly adjacent to a face distinguished by the one who share an edge and the one who just share a point.

    also compatibility to turtle would be nice!

    thx you!

  • Daniel Piker

    Thanks all for the comments, and sorry for the delay in posting the source code.

    In response to some of the questions below - the Rhino-mesh-to-Plankton-mesh function does currently make use of the TopologyEdges from RhinoCommon to iterate through the edges. I think it should be possible to do this a different way with some checks for which edges have already been visited, that would allow an input of closed polylines (this is also the only real use of Rhino specific code).

    Compatibility with Turtle is definitely high on the list of priorities for next things to add. Plankton-to-turtle should be straightforward, Turtle-to-Plankton will I think need the same changes mentioned above first.

    The dual function definitely still has some bugs - particularly when it comes to non-closed meshes. I'm trying to fix this now, but will post at the end of today wherever I get to.

    Faces connected by a point vs Faces connected by an Edge should be possible with the functions in the current release - I'll try and post a demo soon.

  • josh lopez-binder

    wow this looks pretty neat. Is it possible to use this with rhinoPython?

  • Daniel Piker

    Hi Josh. I've not tried it yet, but this is just a .net library so yes, it should work in Python

  • Marios Tsiliakos

    Ignore my last comment! it seems that you have to restart both grasshopper and rhino to work..

  • Anders Holden Deleuran

    FYI, I just had a quick go at implementing Plankton within a Python component, seems to work great. You just have to add a path reference to the Planton.dll, either in the script itself or through the EditPythonScript editor. Attached the file: PlanktonDemoPython.ghx

  • Will Pearson

    Thanks for pointing that out, Anders! Very useful to know for loading any library into a python script component. I'll gladly add python examples to the documentation wish list :-).