Recursive generation of lines with items from the same tree

Hello, what I want is to generate lines from item 0-1, then 1-2…etc. Until the branch ends.
Definition bellow works but its not fully parametric because number of itens may vary.

Thanks in advance (19.9 KB)

“Recursive”? Doesn’t look that way to me. Why not use the Clean points you have to get the top and bottom curves? At least start with that? They could be polylines instead of interpolated. (29.9 KB)

Thanks for your answers Joseph.
Maybe I didn’t explain it properly, I already have the outer curve. It´s about the inner triangles.
What I’m looking for is more like data management, I want that inside a branch, to generate a line between item 0 and item 1, then if that branch has lets say 6 items, the items goes “recursively” interacting with the next ( 0-1, 1-2, 2-3, 3-4, 4-5 ).

The way it is it works until there is the maximum of 3 items on the branch, I could always create more numbers on the list item component, but I wonder if there is a better way. (34.0 KB)

You think? The word “recursive” instead of “iterative” stopped me cold.

I knew that from the other thread so was disappointed those curves weren’t included in this model.

AKA janitorial service because your data trees got garbled.

I don’t see any example of that line? Which points get connected? Did you see this thread yesterday asking for a similar pattern?

No recursion or iteration (looping) required.

The best solution is to re-write the code so the data structure isn’t scrambled but I’ll leave that to you.
Hopefully you learn “The Grasshopper Way” eventually and preserve your data tree structure (or learn how to clean up messes like this youurself).

The white group cleans up your triangles so they are grouped and sequenced by branch. Connecting them with a line should be easy now? (61.8 KB)

That’s exactly it,

my bad just saw the other thread with a similar question now

Thanks, have a great new years celebration.

I just copied that code into version ‘c’ (below) of what I posted earlier but note:

  1. It would be useless without the sorting I did in the white group.

  2. What are you going to do with the pairs of adjacent triangles? (63.2 KB)

P.S. The yellow group below creates a single polyline connecting the Area ‘C’ (Centroid) points, though I doubt it’s what you have in mind? (65.4 KB)

I used the data prior to using the clean tree component, but maybe I have some duplicates, but it seems to be working well. Messing up a lot with the tree structure, should do less of that like you said. (36.0 KB)

I’m not going to look anymore. Posting an image or two along with code is usually helpful.

By the way, your outer (top and bottom) “rocker” curves are not fair at all. It sounds like my efforts in this thread and the previous one about the rocker curve is being ignored? Oh well.