Help:How to cull index base on conditions

Hi friends,
How to cull there buranch on condition: once the second number of these branch index is the same as the last one ? See picture below.


question of cull.gh (11.3 KB)

Can you post a file?

One way

But do share the file

I have a solution, not the most elegant but works, and does not depend on any culling pattern:


I inverted the pattern to show the results:

Nice solution. If you want a simpler one, just check for equality of branch indices → creates cull pattern → done

Edit: Which is exactly what you’ve done

This would work, for sure, only for symmetric tree. If you have something pre-culled and missing some tree element then, I guess, it won’t work.

I’ll have to test it, but no reason comes to mind why it wouldn’t work.

By the way, you’re using cull pattern successfully in your scrpt…

Sure thing, I misunderstood you at first.

I am sorry for I foegot to upload the gh file. And now I have just uploaded it.

Great! I will give a try immediately. Thanks.

This is your tailored solution:


That’s why it is always worth posting sample files.
Don’t forget to invert the culling pattern.

2 Likes

With your help, I get it finally!
Thanks again !