Domain Inclusion test fails

I’m getting this very strange behaviour with a simple domain inclusion test in Grasshopper in Rhino 6 for mac. There is a value that it is clearly within the interval of a domain but the test returns false. I tried doing the same with a C# script but the result is the same. Another strange thing is that I get 7 results from a list with 6 values. This happens both with the C# script and the inclusion test.

If I select the corresponding branches {0;5} on both trees the results are correct. This leads me to believe that the issue is unrelated with the inclusion test but with the tree itself. What could be causing this problem? (11.2 KB)

Your two sources don’t match each other. The Includes component expects one item in each input, while your script expects a list in the second input. I think if you look at the result you’ll see that there are more mistakes, because the sources have very different structures. I also don’t understand why you need to graft in the first input.

It’s failing because you aren’t being precise enough with your tree structure. When you graft the V input, the value you have highlighted comes in at path {0;5;2}, and then you want to compare that to an item in branch {0;5}. The component wont know to compare these as they have different paths. When working with multi-layered trees, you need to take some time before running them through components to get the exact data tree structure in order.

I made a simple cluster for this exact issue a while back which should help you out: (20.7 KB)

I need to graft the values precisely for the reason you mention, the Includes component compares every value of the first input with every value of the second input. If I don’t graft, I get one result for every item of the second list, which is not what I want. The propose of the test is to know in which domain of the list the value is.

Thanks @Matt_Harwood I will have a look.

Use Find Domain component.

Thanks @Dani_Abalde! I didn’t know that one.