algorithmic modeling for Rhino

Anyone interested in physics simulation and processing has probably heard of the amazing toxiclibs library that includes a powerful 2D and 3D physics system (among many other tasty bits and pieces). Recently I had a need to directly integrate particles and springs between processing and Rhino. Since the results were quite effective (compared to my short ventures in kangaroo) I thought I'd share my basic method. 


The processing example is adapted from a basic example that comes with toxiclibs and could easily be converted to 3D. It is interactive (click and drag to move the particles around) and everything works quite smoothly with 300+ particles although rhino only picks up the particles positions when gHowl ticks.


To run this you will need:

Grasshopper (obviously =)





..and my zip file attached.


Enjoy, etc =)


Views: 6627


Replies to This Discussion

this is really cool, i'd like to use this in other processing sketches, looking at the processign sketch doesnt seems to complicated, is it?

as i understand you are broadcasting the coordinates x,y of the points and re-reading it in grasshopper, how can it be done in 3d sketches?

It's not complicated at all, currently its taking each point and adding it to a string as {x,y}, (, being the separating character) ghowl is taking that string and dispatching x and y to separate lists before cleaning them up. z would probably be a case of adding a third value to the dispatch process (eg {x;y:z},{x;y:z}) and then cleaning it up using dispatch and substring components. I'm sure it could be quicker with a VB component that accepts the string and spits out points but yeah. Works for now.
i'll try just like you said, if i acomplish something i will upload an updated file, thank you!
Cheers, good luck =)


I have a question for the third value " z ".

How can i add the third value to the dispatch process?

thank you!

sorry for being ignorant.


how do i get this setup, i opened the sketch in Processing and it's looking for a library that I asssume is in the Toxic i need to copy all the folders in the library from toxiclabs into the processing library folder?


Yup, you want to extract toxiclibs and put that whole folder (toxiclibs-complete-0020) under processing-1.2.1/libraries. You also need to do the same with gHowl: under the folder 'processing libaries to install' there are about four archives. I just copied them to the processing/libraries folder, used 'extract here' and deleted the archives in the folder when it finished.

I think you could send multiple strings as gHowl has persistent data, just tag the beginning of each string and use that as an identifier. This would be a way to do springs or sets of points. 3-4 sets of points would be the beginning of quad meshes/4 point surfaces, alternatively a regularly spaced heightfield could feed into a surface from points component, but I imagine that would take a little longer to solve.


Edit: Okay the XY example has a better way to do multiple lists

are you sure this doesn't need opencv as well? i'm pretty sure it does, although i'm still in the process of downloading that. it tells me hypermedia does not exist right now.

I installed everything but get the following errors in Processing:

"No library found for toxi.geom

No library found for toxi.physics2d
No library found for toxi.physics2d.behaviors
No library found for
Libraries must be installed in a folder named 'libraries' inside the 'sketchbook' folder."

All the Toxiclibs folders (toxiclibs_p5, toxiclibscore, ...utils) are in this folder:

C:\Program Files\processing-2.2.1\lib\Toxiclibs

Does anyone know what's going on?


This thread is really old.

Both processing and toxiclibs have gone through a gazilion different versions(and syntax changes) since then. 

make sue

re that you have this in processing first, by using questions in the processing forum, or finding out which is the latest version of toxi.







  • Add Photos
  • View All


  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service