Hi! Please help me find a way to split list with nulls. I achieved this for one list, but can’t wrap my head to make this work for branches. I am so desperate I tend to use loops. Please stop me before i did this
Split with nulls.gh (17.6 KB)
Split with nulls_2024Oct30a.gh (13.0 KB)
You can right-click on Branch and uncheck “Maintain Paths” to renumber the paths.
Thank you Joseph! Unfortunately, this method does not work with multiple branches.
Plus i would like to save nulls in the end as branches
It works with the data you provided.
I feel both proud and ashamed to use Point Groups on the data represented as point geometries where (X=item_index) and (Y=is_null?), in such a way they have distance =1 if belong to same group, or distance > 1 if belong to different groups…
but that is the best idea I got using only vanilla components
like, here are your groups, lol:
the only issue to overcome is that groups found by Point Groups are not sorted… but that’s an easy fix
of course it works fine even on branches
Split with nulls_inno.gh (18.0 KB)
And you went to the trouble of creating your own test data How kind of you.
Thank you Inno! That is super smart. More and more i notice group points component being used in such unobvious cases. I am not sure why you have used simplify on group points, it prevents algorithm from working with one list. After i removed that, works just fine. Brilliant! Thank you.
On data you haven’t posted? Hope you understand why it fails?
Has it occurred to you that having so many nulls to deal with indicates something wrong upstream? This thread might not be necessary if you cleaned them up earlier.
Inno literally used my data in his algorithm, it is internalized. I put partition list there for multiple branches scenario. I was looking for generalized solution. And no, everything up stream is fine, i am using nulls there on purpose. Stop bullying me