Grasshopper

algorithmic modeling for Rhino

Following on from the images I posted recently (here),

I am now making available the source script for Cytoskeleton.

First, to explain the name:

In 1903 Nikolai K Koltsov  proposed that the shape of cells was determined by a network of tubules that he termed the cytoskeleton

(the name comes from Cyto- meaning cell or hollow vessel)

This is another wireframe thickening tool, intended for 3d printing use.

In contrast to exoskeleton (which works on general line networks), this works exclusively on lines which form the edges of meshes. The additional connectivity information present in this case makes it possible to produce an output with all quads, and moreover, a quad mesh with all even valence vertices.

Because it works on a Plankton mesh, the input can be made of ngons. We can also input a triangular mesh, apply the dual operation, and then thicken the edges of the resulting polygon mesh. This works well in combination with the remeshing script I posted here, for getting approximately equal edge lengths. This can be used to quickly turn any closed mesh into a lightweight hexagonal (mostly - with a few pentagons and heptagons for curvature) frame structure.

The even valence quad mesh property of the resulting thickened mesh means we can also use the mesh direction-sorting and directional-subdivision tools from Kangaroo (described here).

When combined with Weaverbird's Catmull-Clark subdivision, this allows us to smooth the mesh, while also having control over how much 'webbing' occurs at the nodes:

from left to right we see:

  • 2 levels of Catmull-Clark with no directional subdivision
  • 1 level of directional subD, then 2 Catmull-Clark
  • 2 levels of directional subD, then 2 Catmull-Clark

One could even combine the resulting surfaces with all sorts of relaxation, or developable strip unrolling...

The code is there for you to read, so feel free to experiment and make adjustments to it. Hopefully it is fairly self explanatory.

Please feel free to ask any questions or suggest improvements, or just show off anything you create using this.

and yes - because the input and output are both meshes, you can apply it recursively!

This script references version 0.3.0 of Plankton, which you can download here:

https://github.com/Dan-Piker/Plankton/releases/tag/v0.3.0

Views: 40459

Attachments:

Replies to This Discussion

I am also getting the same error as Shalom. I also have the newest version and am not sure what I am doing wrong. 

Thanks

I got this error: [A]Plankton.PlanktonMesh cannot be cast to [B]Plankton.PlanktonMesh. Type A originates from 'Plankton, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null' in the context 'LoadNeither' at location 'C:\Users\loo\AppData\Roaming\Grasshopper\Libraries\Plankton.dll'. Type B originates from 'Plankton, Version=0.3.0.0, Culture=neutral, PublicKeyToken=null' in the context 'LoadFrom' at location 'C:\USERS\loo\DESKTOP\plankton\Plankton.dll'. (line: 75)
my grasshopper version: 0.9.0072

Hope your reply! Thanks.

See my reply to Simon above

Sorry to have troubled you. I made a mistake. Now I delete the dll file at location of destop. It solves, Thanks!!

Sorry I'm new to GH. Is it possible to apply this to a Hexagonal Mapped Surface - Mesh definition as shown below (this could be wrong).

I would like to just apply this Cytoskeleton to a flat plane for now. Later I would like to manipulate the plane.

Funny, I just had the same question after this thread has been silent for over 2 years!
I would like to use the Cytoskeleton script on an Ngon lattice (>4 edges per polygon, e.g. hexes or voronoi).  Planarity isn't important to me.
Is it possible to create a Plankton Mesh with >4 sided polygons?  It seems if I could get there implementing Cytoskeleton would be easy.
I tried the following on an arbitrary open surface:
1) Quad remeshing - Cyto takes in the mesh fine
2) List of edges from Delaunay Triangulation of vertices - Cyto won't take edges directly but will take mesh from WeaverBird
3) Diagonal Grid from LunchBox - Quads also work when edges constructed into mesh with WeaverBird
4) Hex Grid from LunchBox - can't figure out how to get into Pmesh for Cyto. Exoskeleton works but mesh not nearly as clean as Cyto.
5) WeaverBird only works on Hex lattice when valence increased to 6, but then reduces mesh to Tris
Attachments:

Many others helped me figure this out - here's what I learned to help any others trying to solve the same problem (especially those like me who are new to Grasshopper).

This is an example of how to take a network of lines (i.e. a graph) and make a Plankton Mesh, from which you can use Cytoskeleton to make a solid mesh (and then smooth it with Weaverbird).

  • Works with ngons (polygons with 3 or more sides). Other examples I found only worked with tris and quads.
  • Works on open or closed surfaces
  • While these examples start with a surface, you could start with a network of lines and make a patch surface
  • This is meant for 2D networks/surfaces. I haven't attempted filling a 3D volume. My guess is this wouldn't work as it would require a non-manifold mesh that Plankton wouldn't handle.

Note similar results could be achieved with the following:

Working backwards, here is the GhPython script from Will Pearson that builds a Plankton Mesh from vertices and faces.  The vertices are a list of 3D coordinates, the faces are a tree a lists, with each list containing the indices of vertices that form a closed loop. From Will, "Plankton only handles manifold meshes, i.e. meshes which have a front and a back. This orientation is determined by the "right-hand rule" i.e. if the vertices of a face are ordered counter-clockwise then the face normal will be out of the page/screen."

# V: list of Point3d
# F: tree of int

import Grasshopper
appdata = Grasshopper.Folders.DefaultAssemblyFolder

import clr
clr.AddReferenceToFileAndPath(appdata + "Plankton.dll")

import Plankton

pmesh = Plankton.PlanktonMesh()

for pt in V:
    pmesh.Vertices.Add(pt.X, pt.Y, pt.Z)

for face in F.Branches:
face = list(face)[:-1]
    pmesh.Faces.AddFace(face)

These vertices and faces are precisely the output from Starling. Starling takes in a list of Polylines which form the (properly oriented) face loops.

The polyline face loops can be generated...

  • Directly from Panels on a surface using LunchBox
  • Using any network of lines/curves on a surface (curves will need to be converted to polylines before Starling)

The latter was achieved using the Surface Split command, then converting the face edges (converted to curves) into polyline loops to represent faces.

Attachments:

just wanted to say thank you for taking the time to share this!

Hi, 

I am currently exploring skeletal forms and this was very helpful. But I am missing few components. Please let me know what all plugins did you use.

Regards,

Nidhi

Hi,

I am getting error when I open Cytoskeleton script mentioned before. Please let me know how can I fix it?

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service