Grasshopper

algorithmic modeling for Rhino

Hi all, I am trying to get rid of a few long-distance wires and have found a way that looks so simple that I am not trusting it. So before using it in definitions, can someone perhaps test it a little and tell me whether that is safe for every data a wire can "transport"?

Views: 1214

Replies to This Discussion

The type of data that flows through a wire is irrelevant, if it works for one it works for all. Here's what you should pay attention to when replacing wires with this sort of functionality:

  • Expiration events need to travel from left to right. So if you change the curves in the leftmost object, does the rightmost object update by itself?
  • Copy-Paste and Save-Open cycles. Wires are stored as lists of source parameter IDs in the GH/GHX files, can your objects be copy-pasted together? Can your objects be copy-pasted alone?
  • Clusterification. Grasshopper needs to figure out whether a selection of objects on the canvas is disjoint, convex or concave. Only convex selection sets can be turned into clusters. Is Grasshopper still able to determine this when you select only one of your objects? What happens when one of your objects ends up inside a cluster and the other one remains in the parent file?

There also some stuff about growing and shifting selections, but that is not essential functionality.

--

David Rutten

david@mcneel.com

Hi Marcus,

I use this method quite a bit and it works fine. As you probably know you can also share objects between different Grasshopper files using this method. The process of finding the target components to expire the solution is tricky though. You may have to find other ways to do that.

-Mostapha

On a tangential note, I've also found that using cPickle with arbitrary structures of RhinoCommon-based objects is much more flexible and fast than storing geometry in .3dm files. You can create nested dictionaries of Geometry and any other serializable data and then just pickle it.

Hi Ben, What you mentioned sounds really interesting. Do you have an example file that you can share?

I used this previously to save objects that stored particular view states I can't remember what kind of class instance I was saving, but I remember that Steve Baer kindly added serialization methods to that class. I may have been storing viewport objects.  It seems that pickle calls serialization methods on classes if they exist, so anything serializable should work fine. It's actually very easy (link to gist) (python docs about pickle)

here's a link directly to an example in the python docs:

http://docs.python.org/2/library/pickle.html#example

Thank you Ben. This can be really powerful for moving the data around. Will give it a try tonight. -Mostapha

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service