Combine dispatched lists after appending new items

Hello,

Please help me re-learn (again) data structure after dispatching data with three branches.

I have three lists of points, each list has the same number of points:
image

I use Dispatch to split these into two sublists A and B:
image

I append more items (new points) to sublist A:

Sublist B remains unmodified.

Then I combine these two back together with weave as you see above, but the order of points gets messed up as visualized by a curve connecting them before and after:

The problem(s):

  1. My ignorance, obvioulsy.
  2. Dispatch destroys order, yes.
  3. I know I can also dispatch the indices, weave them back, and then sort the woven lists to the woven indices, but because one of the sublists has gotten bigger (points were added), how do I also correctly append new indices?

Maybe that should be the topic title:

“How to append new indices after dispatch” ?

Anyway,

  1. I know I can just Sort Along Curve the new woven lists and it’s all good:

BUT I don’t want to do that ( :clown_face:), I want to learn to append new indices the right way so I don’t have to sort along the curve.

Here’s that part of the code:
AppendNewIndices.gh (12.2 KB)

@ThomasE you helped me with something similar here. The difference is that I wasn’t appending new points.

Thank you.


SplitTree.gh (12.8 KB)

4 Likes

@Mahdiyar thank you for helping me understand what I am doing and growing my knowledge.

Silly of me to be dispatching stuff in the first place.

I will now enjoy a whole day of ‘gardening’ to revolutionize my script before I ruin my work any further :slight_smile:

No matter how simple this is it helps tremendously - it prompted me to understand masks in grasshopper a lot better (again) and dig deep into my bookmarks in the old computer to find this thing again and be a student (again):

Cheers :coffee:

1 Like

Yes, working with masks and trees is always better. Just to avoid doubts with Weave you must adjust your pattern.
Weave.gh (15.6 KB)

2 Likes

Thank you for pointing that out @ThomasE.

You’re right. After spending time cleaning things up, I’ve put myself back in a bottleneck. I’m learning, but have confused myself again.

If you can offer one last bit of help I will be very very grateful.

Here’s the issue:

The original data tree has 40 items per branch:
image
I isolate a subset (32 out of 40) of these items:
image

visual reference:


I then partition this subset:
image
And here’s where I split the tree using the mask @Mahdiyar helped me with.

so I go from:


to:

Lastly, I add more points within the spaces in the split subset:

I need help ensuring connectivity is preserved because the amount of indices has changed.

Simplified file attached:
SplitTreeHelp.gh (20.9 KB)


ReplaceItems.gh (16.3 KB)

1 Like

@Mahdiyar
Thank you - I think I still might have miscommunicated the problem. This is helpful, however the starting points must also make it back into the final list after inserting the new points. You can see the points (red) that were left out:


I did it!

Many thanks for all the help - you’ve taught me and now I can think of other ways to work with this tree by playing with the domains of the indices + masks to split trees and/or sublists.

In the original (bigger) definition, I can now go back to play as long as I keep domains in order.

Also, the issue with ‘appending new indices’ is solved by adding points the way you showed me in the first response:


I complicated things by removing 0 and 1.