How to combine tree branches into a list

Hi,

First of all sorry for the title, I am having a hard time describing my issue. Hopefully a picture helps :


I am measuring the segment length for consecutive points along the polylines. Which gives me X data branches of Y points.
My goal is to combine these X lists together into one list, that first gives me the segment length for all the first to second points, then all the lengths from second to third etc

I will include the .gh file too, please let mew know if anything is unclear.

As usual, thanks a lot for the help
question_list.gh (21.8 KB)

missing

Things quickly deteriorate after that.

My bad I haven’t internalized the point, here is the updated one :
question_list.gh (20.9 KB)

Thank you for your time

I don’t have the plugin anyway so it won’t do me any good. I wrote this purple group using Anemone to align the seams but don’t understand what you want?


segment_lists_2024Feb16aa.gh (26.3 KB) UPDATED

P.S. Are you looking for the lower right text panel? Can’t be that easy :question:


segment_lists_2024Feb16b.gh (28.0 KB)

:thinking:

Not sure if ‘combining’ lists is what you want because that implies you’d be forming multiple lists when in reality you already have all lengths you need?

I don’t have pufferfish either, but you can align seams in a variety of ways, here’s one:


*I forgot to download your second file with the ‘point’.

Then you can also shift the list so you have two and then ‘shrink’ them:

question_list.gh (27.2 KB)

Is this helpful?
Validity of current attempt contingent upon {your} continued refinement of the issue description :grin:

Thank you for your reply.

Right now I have one tree with each branch representing the consecutive segment lengths for each polyline.
What I want is to have all these values in the same branch, but if I just flatten the output I will get one list containing all the branches one after the other.

What I want is basically a list with all the values but in the index order :
All the first values from each branch then all the second values from each branch etc

Is that clearer? I wish I could explain it in french aha :smile:

Thank you very much

1 Like

:rofl:

Nice.

Is clearly different from:

I think :stuck_out_tongue:

That sounds like Flip Matrix and flatten?

Like that? The first value from each branch would be index 0?

Exatcly yes

1 Like

Simply connect the output of the last component (flip matrix) in the file I shared to a ‘list item’ component as it has ‘0’ as the default index:

So if all is good right now maybe the more specific title was “extract first item from each branch” ? Lol - still too general without context obviously - it makes sense you wrote it the other way because you first needed to grab the lengths from 0 to 1, 1 to 2, 2 to 3, etc.

I see nothing wrong with your English by the way :ok_hand:t5:

Best

Almost that aha.
I want this to repeat for every single item of the branch not only the first, does that make sense?

I think so - what’s the ‘data structure’ of said list, though? If you just want every first item from each branch after measuring the consecutive lengths, you already have that
if you want all the items of each branch in one single list, then as Joseph suggested simply flatten the result of the flip matrix component, the only difference is that now you have shifted the point lists and obtained the consecutive lengths - so ignore the ‘list item’ because that only gives you one value from each branch - If this isn’t correct then you should probably draw or mark on a screenshot what you want - note that in the screenshot I asked about you said ‘yes exactly’.

I have missed Joseph’s answer, this is what I needed.
I can’t believ I didn’t think about that, there is still much work needed from me to be useful with Rhino.

Thanks a lot for your time, it is much appreciated :handshake:

1 Like