Grasshopper

algorithmic modeling for Rhino

When I create a multidimensional array of "On3dPoint" points in a VB.net script component, the output parameter data is always "flattened" into a single list of points.  My array is definitely multidimensional because I can output single values (eg. point(4,13) returns the correct point x,y,z).  Is there a way to keep the structure of a multidimensional array intact?

Thanks! Justin

Views: 776

Replies to This Discussion

How would you access that multidimensional data in GH though? There are really only methods for dealing with single lists of data, not multidimensional ones, so that's really the fundamental issue. If you want more structure than just one long list than your going to have to create your own data tree, which has the potential of mimicking a multidimensional structure fairly closely. I'd do a quick search for data tree as there have been a few threads that go over creating them.
Damien: Thanks for the tip. I'll look into creating a Data Tree from my points rather than a multidimensional array. Do you happen to have any examples of how to do this?

What I want to do is simple: Let's say my script creates 100 points. Instead of 100 points in 1 path, I'd like output 10 paths with 10 points in each path. (Then I could plug these points into another GH component that would create a curve, etc.)
You should look at scripting your points into a DataTree structure...
Thanks Luis! Do you know of any examples that show how to do this? J
Here is an example (not sure if I made it or dl it) that takes in two lists of points and organizes them in a tree. Kind of an obsolete example now, but at least the vb code could get you going in the right direction.
Attachments:
the example above was downloaded, but can't seem to find a proper link...

Here is another thread where Rajaa Issa has an example of generating a grid of points in a datatree structure.

http://www.grasshopper3d.com/profiles/blogs/generate-grids-with-vbnet
Many thanks Luis! I'll check out the examples ASAP! Best, J
Luis: Thanks a lot. The examples you pointed demystified the Data Tree and my script is working perfectly now. Best, Justin

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