Grasshopper

algorithmic modeling for Rhino

Hi all, 

I've been seeing this Goo showing up as an object that contains a bunch of geometry (as far as I understand it.) Is there any way to take geometry that is scripted in manually, such as different lines and circles or what-not, and then bunch it all together into one Goo variable? I am trying to rotate geometry that consists of different shapes and I want to avoid having to rotate/translate each piece individually.  

Preemptive thanks!

Views: 2912

Replies to This Discussion

IGH_Goo is an interface which is supposed to 'wrap' data types in such a way that Grasshopper understands them. There are various implementations for common types such as bool, int, string, and a bunch of RhinoCommon types. You rarely have to deal with goo directly because Grasshopper tries to abstract it away as much as possible.

When it comes to scripting however, there is one common use for goo, which is to wrap an output into a specific goo derived type called Grasshopper.Kernel.Types.GH_ObjectWrapper, as that will prevent the script component from trying to interpret what sort of goo was meant by a certain output. Using the ObjectWrapper you can for example easily pass arrays, dictionaries or other collections between script components, without GH trying to interpret your data as some sort of list.

Groups in Grasshopper are meant to be collections of transformable geometry. Perhaps you can use that to achieve your goals?

Thanks David!

So, say I had just a random bunch of dissimilar geometries, such as cylinders, cones, and circles, and I wanted them all in one big heap, so I could bulk translate/rotate them all.  Is a group what I would want to use to accomplish this? And if so, can you point me the right direction regarding how to educate myself on scripting with groups?

Also, on a side note, how the heck do you have time to answer all these questions from newbs like me? Are you a time lord? 

In the Transform tab you can find component that create groups from lists of geometry and then another one which turns groups back into loose objects. The problem with scripting and groups is that they get 'unpacked' by the scripting component and converted into a list. This means you have to go in and harvest the groups directly from the inputs, which almost seems more trouble than it's worth.

If you're scripting transformations, why not just set the input which takes geometry to List or Tree and perform the looping inside the script? 

Attachments:

Hi David! 

So, my goal is to simply generate a very custom geometry that will not change based on any input from the user, except perhaps by a scale factor. This geometry, which is composed of a rectangle, three cylinders and three cones, is basically functioning as a reference axis for the user. In essence, I am taking a set of vectors, and recalculating the resultant vectors based on a new axis. I can handle the mathematics of this process in the scripting, and the resultant vectors and corresponding magnitudes are coming out of the component as outputs.  But I want to have a visual reference axis so the user knows which way the "new" axis is pointing. So, any way to replicate a shape composed of more basic shapes without having to translate/rotate every single basic shape?

If these shapes are just visual clues, perhaps it makes more sense to only draw them and not push them into the Grasshopper document as geometric data?

David,

That might be what I have to do, for my simple mind may not be up to the task of doing things differently. I just thought that there was a way to create random shapes within a script, and then group all of these difference instances into one instance of a general type, and then simply translate/rotate the entire group at once. 

Thanks for all your help!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service