Grasshopper

generative modeling for Rhino

Rheotomic surfaces and flowline generation tool

Around 3 years ago I wrote an essay on my blog about what I called rheotomic surfaces - a type of surface I had developed related to fluid flow and electrostatics, and a technique for their generation using complex numbers.

Since then I have received a lot of questions from people interested in the details of exactly how these surfaces and their associated curvilinear orthogonal grids were generated.

Now I've packaged it up into a Grasshopper object with an easy interface, and am releasing it publicly so anyone can experiment with this tool.

(See this video for an example of it in action)

When the idea of using the streamlines of a flow to generate a surface first occurred to me, I thought the way to go about this would be to integrate a 2d vector field from various seed points and then move these lines vertically and loft between them - but after a lot of head scratching and experimentation, I was amazed to discover that it is actually possible to skip that step altogether.

In this technique, the surface is generated first, by moving the points of a mesh vertically from the complex plane according to the scalar values of their real and imaginary components, to generate 2 separate meshes. One of these meshes gives the rheotomic surfaces described in my essay, with helicoid shaped regions near the sources and sinks, and its contours are the streamlines of the flow (hence the name). The other mesh has sharp funnel shaped regions, and its contours give the equipotentials of the flow, orthogonal to the streamlines.

One of the advantages this technique has over vector field integration methods is that there is no problem of choosing seed points for streamline placement, and nice even spacing happens automatically. We also avoid the difficulties with cumulative error common to such methods.

By multiplying by other complex factors it is also possible to generate lines at specific angles to the streamline/equipotential directions and create various grid types.

Also because of the mesh contouring technique, these are actual vector curves being created, not just pixel based mappings.

Because the complex logarithm function is multivalued, dealing with the mesh in a way that avoids a sudden jump at the branch cuts does require a bit of special treatment, and it is not quite a straightforward height map, but I found that it is possible to avoid the usual techniques for contouring a 3d scalar field.

This definition outputs both the curves and the meshes. The meshes produced are singly periodic - you can make copies vertically shifted by 2*Pi to get a continuously spiralling surface, and if you also shift them by 1*Pi you get the other half of the helicoids, and it can all be joined into a complete and smooth surface.

So enjoy, I hope you find some interesting and original ways of using and developing this. Please do remember to attribute properly - a lot of effort has gone into this, but I'm freely sharing it in the hope that will be respected.

I've chosen not to compile or obfuscate anything, so you can easily pull it apart and see how it is all working. The original essay linked to at the start contains some suggestions of further reading if you want to learn more about complex numbers and flows.

The file: Rheotomic_Surfaces.gh

Released under the creative commons attribution share alike license 3.0

http://creativecommons.org/licenses/by-sa/3.0/

Views: 9023

Comment

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

Join Grasshopper

Comment by NikFromNYC on Friday

I discovered a glitch: if a source point has too similar a Y value to a sink point to its right, dark bands of lines appear and this doesn't happen for X values.

Upping the resolution setting to over 100 or 200 only rids these for points that are not really very close in Y value and otherwise fails so for now I'm rotating my whole point array to manually move Y values around until I get lucky, but since the line artifacts are made of dozens of little segments connected to correct curves, cleaning up is impractical for complex inputs. I made a pretty version of the spaghetti inside the black box to guide me:

Comment by NikFromNYC on June 13, 2013 at 1:55am

It's fun to delve into the black box here since it's open source and has lots of internal Grasshopper structure. Alas, how do I also output your circle packing example (http://spacesymmetrystructure.files.wordpress.com/2009/02/circles-c...), I wonder? These curve networks exactly match a very old Macintosh screen saver called Flowfazer created by rock star Todd Rundgren that was recently re-released as an iPhone app. Back in the 1990s it was quite ahead of its time!

Comment by Guy Gardner on January 20, 2013 at 5:30pm

Hi Daniel,

The file opens, and the Rheotomic cluster is grey, but the curve and mesh components attached to it are orange. If I open the cluster, the two c# components are red and they both give the error I mentioned.

Comment by Daniel Piker on January 19, 2013 at 6:24am

Hi Guy,

I don't follow when this error occurs - the file opens, and the 'Rheotomic' cluster is there, but orange with no outputs ?

and then you opened the cluster? which C# component throws the error?

It's odd, as it doesn't use any non-standard grasshopper components, and the scripts don't reference any extra libraries.

Comment by Guy Gardner on January 18, 2013 at 9:09pm

Hi, I would like to use this component, I'm not getting errors on opening, but I'm not getting any ouputs and I'm getting the following error from the C# component 1. Solution exception:Could not load file or assembly '0e62753f-604d-4f70-8b8f-6da90af8fe5f, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Access is denied. 

Any suggestions?

Comment by Anna B on December 19, 2012 at 12:23pm

Tiziano, just to ask the obvious question: maybe you don't have the correct version of grasshopper to open it? Do you get an error message when opening the file? At first I had the same problem so I had to install the last build of grasshopper for Rhino 4. Whichever number that was... Trying to continue opening the file after getting the error will not work.

Comment by Tiziano Derme on December 19, 2012 at 9:49am

hi Guys, I'have downloaded the Rheotomic surface.gh but in the definition the rheotomic component didn't appear.

Could you upload another time, that component please..?

Thanks

Comment by Daniel Piker on December 6, 2012 at 1:28pm

Hi Dimitris,

I've just answered a similar question here:

http://www.grasshopper3d.com/forum/topics/set-boundary-in-rheotomic...

Comment by DIMITRIS VENIZELOS on December 4, 2012 at 7:02am

Hello, I am very fascinated by this tool . I woul dlike to learn more about the mathematics of this topology, any suggestions ?

Also I am experimenting with the flowline generation tool and I have a question. Can I use this tool in a boundary shape that is not a rectangle?  

thanx!

Comment by Daniel Piker on November 23, 2012 at 1:30pm

Glad you like it.

As it is a cluster rather than a compiled component, you can open it up by right-clicking, and see how it is working.

The different options (streamlines, equipotentials, square, triangle etc) get converted into a complex number or a list of complex numbers which are then used to multiply the whole solution.

So multiplying by (1,0i) creates a surface of which the sections are streamlines, whereas multiplying by (0,1i) causes the lines to rotate by 90° to give equipotentials

(Geometrically, multiplying by complex numbers results in scaling and rotation. Remember that by definition i*i gives -1. This can be seen as a rotation by 180°, so it makes sense that rotating by i rotates us 90° away from the real number line)

The square input just uses a list of complex numbers ((1,0i),(0,1i)), so it outputs both surfaces, and both sets of lines.

Translate

Search Grasshopper

Photos

  • Add Photos
  • View All

© 2013   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service