Grasshopper

algorithmic modeling for Rhino

Information

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.

Website: https://github.com/meshmash/Plankton
Members: 381
Latest Activity: Jan 30

Discussion Forum

Cytoskeleton 27 Replies

Following on from the images I posted recently (here),I am now making available the source script for Cytoskeleton.First,…Continue

Tags: mesh, Plankton, Weaverbird

Started by Daniel Piker. Last reply by Serge Jul 31, 2020.

Target valency remeshing

Hi,I’m using mesh machine to have a good triangulation of my mesh but I was wondering if I can set target valency for my edges in order to control triangulation. I want to have a triangulation where…Continue

Started by Contestables Jan 21, 2020.

Dynamic remeshing script with Plankton and Kangaroo 90 Replies

Here are some demo's of remeshing with Plankton combined with some relaxation functions from Kangaroo.(Similar to what I described here: …Continue

Tags: remeshing, mesh, Kangaroo, Plankton

Started by Daniel Piker. Last reply by Contestables Jan 20, 2020.

Internal data structure 5 Replies

Plankton 0.4.2. If I take any simple mesh object generated in grasshopper and convert it with the PMesh module, then try running the following python code, I get:for v in…Continue

Started by Cory. Last reply by Will Pearson Nov 27, 2018.

Comment Wall

Comment

You need to be a member of Plankton to add comments!

Comment by Anders Holden Deleuran on April 3, 2014 at 6:19am

Hehe, no worries. One of my main headaches with assemblies was always trying to figure out their actual name (as in, not the file name) and their actual content (available types), I just spent a little time looking into assembly introspection. Seems pretty straight forward, attached a small example. I suspect this could be useful for you Mathias. Best, Anders

140402_AssemblyIntrospection.gh

Comment by Will Pearson on April 2, 2014 at 5:28am

Oh gosh, you're right. I've just realised I've got both Plankton.gha and the PlanktonGh.dll that Daniel packaged with Kangaroo... Sorry for muddying the waters!

Comment by Anders Holden Deleuran on April 2, 2014 at 2:05am

Thanks Will. That's certainly true. In your example "PlanktonGh" refers to the "old" .dll correct? The one which is now simply called "Plankton.gha"? In which case one has to use "AddReferenceToFile" as there are now two files with the same name, but different extensions (which I think I prefer actually). Anywho, just tried out the following which seems to work for importing all the dependencies for both Plankton and Kangaroo:

# Reference .NET assemblies
import clr
clr.AddReferenceToFile("Plankton.dll")
clr.AddReferenceToFile("Plankton.gha")
clr.AddReferenceToFile("KangarooLib0096.dll")
clr.AddReferenceToFile("Kangaroo0096.gha")

# Import Plankton
import Plankton as pl
import PlanktonGh as plGh

# Import Kangaroo
import Kangaroo as ka
import KangarooLib as kaLib
import GhKangaroo as kaGh

Let the digging begin :)

 

Comment by Will Pearson on April 1, 2014 at 6:17pm

It's all personal preference but here's how I do things (off the top of my head):


import clr
clr.AddReference('Plankton')
clr.AddReference('PlanktonGh')
import Plankton
import PlanktonGh.RhinoSupport as planktongh
pmesh = planktongh.ToRhinoMesh(mesh)

(Note that Plankton.dll and PlanktonGh.gha are in my Libraries folder.)

Comment by Daniel Piker on April 1, 2014 at 10:34am

Hi Mathias,

Yes - that's correct, the remeshing example uses some functions from GhKangaroo.MeshPhysics, so you'll need those libraries referenced. (I'm looking though at whether it might be better to keep all these functions in the .dll in future)

Comment by Mathias Gmachl on April 1, 2014 at 9:24am

Thanks everyone for looking into this. I did see the ToPlanktonMesh command in the C# examples, but couldn't get it to work without the references.

In order to script Kangaroo functions like in the remeshing examples, I assume I need to reference the kangaroo .dll and .gha aswell?

Comment by Giulio Piacentino on April 1, 2014 at 8:04am

Hi guys,

right now clr.AddReferenceToFileAndPath is I think the correct method to use here. That .dll has to ultimately be added to the Python context. More in general, McNeel might want to add a new registration to AssemblyResolve for .gha files. Let's see also what Steve thinks.

Giulio
--
Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

Comment by Anders Holden Deleuran on April 1, 2014 at 7:53am

Edit: I see you already figured it out Daniel. I attached another version which assumes that the GH library folder is read by RhinoPython, but offers the perhaps least "ugly" method :)

140401_PlanktonDemoPython_Update03.gh

Comment by Anders Holden Deleuran on April 1, 2014 at 7:30am

Thanks Daniel,

This does seem to make Plankton more tricky for Python implementation. In order to reference the Plankton.gha I renamed it PlanktonGh.dll and imported in the same way as Plankton.dll. This provides access to the RhinoSupport class which contains the ToPlanktonMesh() method, allowing us to call it in a procedural manor. This is not exactly pretty, but does seem to work. Attached the example from before.

Perhaps this is something for Giulio/Steve to have a closer look at. I have already suggested that the Grasshopper library folder be add..., but it seems that this could use some deeper thinking/planning in general (should we be able to import .gha files etc.).

Best,

Anders

140401_PlanktonDemoPython_Update02.gh

Comment by Daniel Piker on April 1, 2014 at 7:19am

ok - this seems to work:

import clr
clr.AddReferenceToFileAndPath("C:\Users\Daniel\AppData\Roaming\Grasshopper\Libraries\Plankton.gha")
import PlanktonGh as pl

pMesh = pl.RhinoSupport.ToPlanktonMesh(mesh)

 

Members (381)

 
 
 

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service