Grasshopper

algorithmic modeling for Rhino

hi,


from a given data-tree (see picture) where only branches {A,B,0} and {A,B,1} contain integers (not lists!), how can i recreate the tree skipping all {A,B,0} branches and only keeping the {A,B,1} ones? thought this would work with the path mapper, but i just can't get it right.


best, heinz.


Views: 1881

Replies to This Discussion

to sum it up: if i give the path mapper {A;B;1} as the source map, will this filter the tree such that only branches ending with a 1 are processed by the target map? i understood it this way, however, the result always exhibits all the branches. best, heinz.
What about using the Param Viewer to generate the path list and then cull every branch you don't need and then using the retrieve selected branch component to get the desired branches.

hey danny, that's exactly how i am doing it atm. my goal is to fully understand the capabilities of the path mapper, since i am working on a rather complex project where optimal usage of data-structures is quite crucial.
As I understand it the Path mapper is not meant for this specific task. What is wrong with your current method? Is it to do with generating the cull patterns?
nope, the method is okay, i just thought it possible with the path-mapper.

and hey - here's yet another stupid question i don't dare to start a thread with (unless i don't get an answer:):

i have two separate lists of objects, both in {0}, which i want to put in a data-tree such that my lists sit in {0:0} and {0:1}, respectively. interestingly, i am unable to find a component for that, the merge component doesn't do the trick at least. however, i want to avoid starting too many c# components, because sooner or later it would make more sense to program the whole thing in the first place.

best, heinz.
...if you have a list you can use [Flatten] to assign a path name...

ahhh, i wasn't aware of that. thanks a lot!

heinz.
Have you tried the Weave component.

Heinz,

To better understand path mapper component, I offer this clarification. Your observation that optimal usage of data-structure is "critical" is spot on.

As you perfectly illustrated, each branch of your tree is identified by an "address". In order to match the data in two separate trees for successfully computation, it is best for the addresses of each tree branch to be in the same format; i.e., with the same number of place holders. For instance, {0;0;1} vs {0:1} vs {1}. I think of the path mapper component more like a "tree branch address format changer". It does not manipulate the branches, it merely manipulates the branch "addresses". You use the other logic components from the list menu, sets menu, or tree menu to select particular branches or subsets of branches.

The post by Sameer Kumar on December 7, 2009 was the post that finally helped me over the hump you are trying to get over. It is most understandable and well illustrated regarding the path mapper purpose.

http://www.grasshopper3d.com/forum/topics/path-mapper-component-wha...

One side note, I have noticed that grasshopper will match data that is not perfectly in the same branch address format. But I have not yet figured out the logic of how this works exactly. Perhaps someone with a better grasp could explain how GH matches data when the paths are not perfectly mapped. Understanding this less formal logic might eliminate the need to employ the path mapper every time.

Good Luck
Stan
The matching of different branches is unfortunately a bit wonky at the moment.
In fact, Grasshopper doesn't even look at the addresses when matching. It merely picks the first branch in Tree A and matches it with the first branch in Tree B (and then the first branch in Tree C if more than two trees are involved).

I'm planning to add better branch matching logic, but I'm not going to touch it until I have a good idea about what's needed and how it can be accomplished without breaking existing files.

So, the branch "address" is only used to sort the branches in a single tree. Thus, a tree with the following branches is always sorted in the exact same way:

{0;0}
{0;1}
{0;2}
{0;3;0}
{0;3;1}
{1;6}


If you have another tree with different branches:

{0}
{1}
{2}
{3}
{4}
{5}


Then the matching will be:

{0;0} -> {0}
{0;1} -> {1}
{0;2} -> {2}
{0;3;0} -> {3}
{0;3;1} -> {4}
{1;6} -> {5}



As long as people adhere to your advice: "it is best for the addresses of each tree branch to be in the same format", there will be no problem. But it is at the moment extremely difficult to perform complex matchings.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
Thanks for clearing this up. Understanding this will be a great help.

And I appreciate you using my new favorite adjective "wonky". Its perfect!!!

Thanks David

Stan

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