Split Tree in a Checkered Pattern

Hi forum! Is there a way to make split tree mask that would output checker style pattern? I can not wrap my head to make it into single mask

Split tree F.gh (158.9 KB)

I think this works.

{0,2,…}[0,2,…]
{1,3,…}[1,3,…]

damn why i never even considered this

You saved me from that:

There is also that

Thank you, need to use path mapper more often

what does the ‘%’ do?

It is a modulo function
1%2=1
2%2 =0
3%3=1

A is branch number
i is list index number
=> if sum (A+1) is even => branch 0
=> if sum (A+1) is odd => branch 1

so here if I choose 3=> 3 branches

The problem with this though is that it will flatten the branches.

You are right, but I am not sure how many people design their Grasshopper script with very complex DataTree structure. For my projects (simple one surely) I quite don’t use DataTree in Grasshopper, I prefer to rely on objects in C# and dedicated component. DataTree support some complexity but has no knowledge of what it deals with. Metadata in GH2 will surely be a better way of handling complexity in “pure” GH script.

It’s actually not so much of a problem. You can prepend the modulo path to original path, so that you get like an entwine in after thought. I just thought I’d point it out:

'Glad to be late with a bruteforce approach :slight_smile:

Meanwhile I learned A TON from the responses here—thank you.

There really isn’t anything you can do with Path Mapper that you cannot do with a deconstruction of a fully grafted Data Path mapping and Replace Paths. Here, for example, @laurent_delrieu 's solution with the added flexibility of being able to dynamically set the group spacing and targeting a group set with the Set Slider Properties component from Metahopper. Static path mapping is a big drawback of using Path Mapper.


Split Tree in a Checkered Pattern VR 1.gh (173.7 KB)