Grasshopper

algorithmic modeling for Rhino

Grasshopper should match multiple input trees more intelligently

I'm dividing up two surfaces into UV coordinates and using the coordinates to draw curves on the surfaces. I put the two surfaces into a graft, so that one is at {0:0} and the other is at {0:1}. Then I create trees of UV points for the lines with two points at every branch. This tree has branches
{0:0:0:0}, {0:0:0:1}, ..., {0:0:0:35},
{0:1:0:0}, {0:1:0:1}, ..., {0:1:0:35}
(the first two numbers in the path correspond to the surface). What I want it to do is draw curves for UV points {0:0:0:*} on surface {0:0}, and draw curves for UV points {0:1:0:*} on surface {0:1}. But when I put the surface tree and UV point tree into a CrvOnSrf (longest list, no flattening), they don't match up properly. Instead it draws all the curves on surface {0:0}. I thought the whole point of trees was to make what I was expecting happen automatically.

To work around this problem, I created a new tree where branches {0:0:0:0}, {0:0:0:1}, ..., {0:0:0:35} each had one copy of surface {0:0} and branches {0:1:0:0}, {0:1:0:1}, ..., {0:1:0:35} each had one copy of surface {0:1}. Thankfully Grasshopper matches this tree correctly because paths of these surfaces match the paths of the points exactly. But it's such an inelegant solution and it shouldn't be necessary. Grasshopper should match tree branches more intelligently (and allow the user to select different schemes). To state the scheme I am describing precisely: whenever a component has two input trees, branch {A:B:...:X} of the smaller tree should be matched with branches {A:B:...:X:*:*:...:*} of the larger tree. I think that would be what users want in most cases.

Views: 3599

Attachments:

Replies to This Discussion

Hi,

back again at my favourite topic. I love the script above, but I came to a point where it doesnt work, if the List is not consistent. Any Idea for this?

And another thing: is there a better way to split a three , but by a pattern? I´d like to have something where I can divide to positive, negative side by inputing the specific path, not a mask.

Thanks,

Phillip

Attachments:

At least for me, your persistent data doesn't deserialize properly - could you upload the associated rhino file and a .gh with referenced data instead?

I see. strange, I also had a problem with ctrl+c, ctrl+v into another document with the missing planes. Some bug...

Please try again, this should work.

Attachments:

and just in case...

Attachments:

If I've understood the problem correctly, a script I wrote to assign an arbitrary path structure to a flat list of data might do the trick. See if this is what you wanted.

Not really.

The script should match as shown in the picture. Ideally it would also have an input where you could say to which branch, like in the path mapper.

e.g.:

in:

Data 1: {a;b}

Data 2: {a;b;c;d}

O: +1

Out:

transferred Data 1: {a;b;c} according to the structure of  Data 2

A little like an inverted shift paths.

Do you know what I mean?

Attachments:

whoops, made a mistake in the last upload - try this one.

Attachments:

Like this then? Doesn't have the shift input, but should automatically match up the two sets. Haven't tested it much, just put it together, so use with caution! 

Attachments:

on a second look I'm still confused about what you're trying to accomplish. Doesn't Vicente's script do what you want so long as you pass it the right data to match?

Attachments:

You are right in this example it totally works. I mixed up the wires in the middle.

But still I think what you posted the second time, solves it.

Let me post the situation I am trying to explain in a better example later...

Thanks

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service