Flip Matrix of complex tree?

Hi guys,

I have stumbled across data management problem:

I have lines organized in one direction and I need them in the other direction to be able to tween the segments.

Flip.gh (20.3 KB)

Thanks for any help
Shynn

Try Path Mapper (Your ‘good structure’ wasn’t internalized)

Oh crap, it was just the first 5 red segment lines.

The colors mean the columns of data I need in order to create the tween lines between the existing ones.

Flip_RE.gh (16.7 KB)

Thank you Jakinta, I think I can use this.

I wonder if another method is possible, a less geometrical one, with only data operations.

What exactly are you trying to accomplish?

Unless you are assigning data, its going to be geometrical solution.

Hi Rickson,

What do you mean by “assigning data”?. The desired result is exactly what Jakinta did. That was the goal.
The operation is literally a flip matrix on a tree, only that the he branches of this tree have different number of items.

“Flip Last” from TreeSloth by @dave_stasiuk might do the trick here

1 Like

but it may be extra difficult because your tree is not “rectangular” (the branches are not all the same length)

So this is a one off solution or something that you want to run dynamically on a wider set of data?

You can assign user data to objects that allow you to create branches in any form you want.

Yes. Its not much that I need to run this on a wider set of data, but rather that as the parameters are changed, the whole form of the lines and hence points change, making me be skeptical of a global geometrical solution. That is why I was hoping for a solution based only on data operations, which is, generally speaking, much more global than a geometrical one.

I wonder, how can the Tween lines now go back to the previous tree structure so that they can be joined in one single polyline?

1 Like

Hi Jakinta,

Thank you for the reply! I am afraid though that for a reason unknown to me, the join get messed up on this case. :frowning:


flip2.gh (48.2 KB)

Can you attach unflattened initial curves?
I think the key lies in how are they made. Forward thinking in that preprocessing can lead to more general solution, if it is even possible…

Sure!
flip2_b.gh (61.2 KB)

Huuh,here it is. Main problem was that your branches {0;0;4} and {1;0;0} was actually duplicates…
But as i mentioned earlier it should be rethinked how you get those curves originally. At that stage this should be done like to lead to a more general solution later…

flip2_b_RE.gh (81.1 KB)