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.

Load Previous Comments
  • David Bachman

    First time trying to write a C# script using a plankton mesh. I've connected the output of a PMesh component to the input of a C# component, and named that input "pmesh". Inside the script I'd like to call a method such as:

    int count=pmesh.Vertices.Count;

    However, I get an error that `object` does not contain a definition for `Vertices`.

    Any advice?

    Thanks,

    Dave

  • David Stasiuk

    First off, just confirm that you've added both Plankton.dll and PlanktonGh.dll in "Manage Assemblies", and then added using Plankton; using PlanktonGh; in the usings.

    Then, if you want to input a PlanktonMesh, you have to cast it from the default object type. If your input is called pmesh, then it would be something like this: PlanktonMesh myPMesh = pmesh as PlanktonMesh.

  • David Bachman

    Perfect. Thank you!