Grasshopper

algorithmic modeling for Rhino

How not to keep the index when merging a list of points?

Good afternoon,

 

Would anyone know how to merge a list of points like the one below without changing the index?

 

Many thanks,

 

Arthur

 

Views: 680

Replies to This Discussion

It works when removing one unused branch in one of the list but gives a very strange tree structure as output. How could I get a "regular" grafted tree as output?

 

Hey Arthur,

You could modify the last path index of each group so that the two trees are staggered.

ie. if both incoming trees have the structure {A;B} (i)


tree 1 target {A;B *2}

tree 2 target {A;B *2+1}

 

Attachments:

Perfect! Thanks a lot David.

Why is the B multiplied by 2 first, isn't +1 enough to stagger ?

If I would like to group the result in pair should I do it afterwards ?

Cheers

No problem.
You gotta get the *2 in there though, otherwise you'd get one tree with a shifted path index instead of the staggering.

ie. with only +1 on the second tree let's say

tree1 would look like {0;0}, {0;1}, {0,2}, {0,3} ...
tree2 would look like {0;1}, {0;2}, {0;3}, {0,4}...

 

For pairing the resulting tree you could do something like this afterwards
{A;B} -> {A; floor(B/2); B}


Attachments:

Thanks David, very helpful.

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