Grasshopper

algorithmic modeling for Rhino

After reading the Grasshopper Primer and Generative Algorithms, I can conclude that (at least in these two books) not enough attention has been payed onto the data matching. In my opinion, this is one of the most important parts of Grasshopper (if not the most imporant one).

In both books the very basic examples of data matching were made (Shortest list, Longest list and Cross reference) in cases when we have two lists with only one branch.


But what happens when we have data matching, but with lists on several branches?

Here is the simple example I am working on, and trying to understand the data matching from it, but I am not succeeding.

I have a three groups (lists) of points1 on three separate branches.
And I have two groups (lists) of points 2 on two separate branches.

I am trying to connect these points with "Ln (Line)" component, with "Shortest list" data matching:
And there comes the problem:

Why does grasshopper use the points from the third branch of the points1, when there is not "enough" number of points in the points2? If I choose the "Shortest list", than I guess that should mean, that first two points from the points1 {0;0} branch should match with two points of the points2 {0;0} branch. Then first two points from the points2 {0;1} branch with two points from points 2 {0;1} branch. But why does grasshopper use the two points from the points1 {0;2} branch to match with two points of points2, branch {0;2}?

points1    points2
{0;0}  -->  {0;0}
{0;1}  -->  {0;1}
{0;2}  -->  {0;1} ???

Thank you for the help.

Views: 974

Attachments:

Replies to This Discussion

The problem is that ShortestList/LongestList/CrossReference only apply to items-within-lists. It does not apply to lists-within-trees. Lists-within-trees are always combined using LongestList logic which is why two of the points in {0;2} connect to the two points in the {0;1} set.

Come 0.9.0002 there will be some changes to the way items are matched, however the initial release will work the same when it comes to lists-within-trees. I will need to come up with a flexible yet understandable interface for exposing ways in which lists are matched up and I haven't even started seriously thinking about that.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thank you for the reply David.

I saw those new 0.9.0002 Data matching components in your topic somewhere on forum.

So for now, the only way to do this is too delete the last branch from the points1 tree?

Can you show me, how can I for "n" number of branches in 'poinst1' tree, and for "n-1" branches in 'poinst2' tree, delete the last branch of the 'poinst1' tree?

you can retrieve only the branches you want from one list based on the branches of the other list.

Thank you for the help Michael.

I did not know what does that Retrieve branch component does.

Can I ask you for one more thing, please: Can you show me what would I need to input into the "P" input of that component, in case that I did not want to use the "Param viewer" from Points2?

What kind of path (simply written in Panel for example)?

as it says a path so

{0;0;0}

you know, that kind of stuff :)

I took a new Panel and simply typed in:

(0;0;0)

Then connected this Panel with P input of "Retrieve branch" component.

And I got an error message in the "Retrieve branch" component:

Data conversion failed from String to Path.

?

EDIT: My bad, I needed "{}" instead of "()". Thank you.

But I did not get the same result as above. Take a look:

?

EDIT2:

I think I understand now.

I need to type in all branches (paths) that I want to extract from particular tree.

So in this case I need to type:

{0;0;0}

{0;1;0}

(as I do not want the third branch: {0;2;0} so I will not include it)

The key to my problem was also that I need to uncheck the "Multiline Data" from the Panel.

Now it works!!!

Thank you Michael !!!

I owe a beer crate for all this!

EDIT2:

I think I understand now.
I need to type in all branches (paths) which I want to extract from particular tree.

So in this case I need to type:

{0;0;0}
{0;1;0}

and leave {0;2;0} out of it, as I do not want it.

The key to my problem was also that I needed to uncheck the "Multiline Data" from Panel.

Thank you Michael.


Can I dare to ask one more question?

Is there any programming way to type some character which will enable, to retrieve all the branches, except last one?

For example can I use this path:

{0;1#;0}
(# character is just a simplification, I do not know which one I need)

Which will mean to retrieve all the branches, exept the ones that come after the {0;1;0} (in this case the last one - {0;2;0} )
?

Why not just use the param viewer to get the list of paths and use a shift list with a '-1' as the second input to remove the last item from the list?

Thank you for the help Luis. It worked, and I did not know I can Shift data backwards (-1)

David were can we get the 0.9.xxx Ver of GH  the lasted downloadable version in the Page its  0.8.0062

or the lasted version its just for beta testers?

Hi Toussaint,

you can't, it's not publicly available. A few people have been testing and I've send some versions off to GHA developers so they can see if their stuff still works. When I woke up this morning I thought I was all done but someone just send me a list of 7 more bugs that really do need fixing.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service