Polygon.ContainmentTest for Sublists


#1

I am looking to run the Polygon.ContainmentTest for each [ x ] sublist of polygons to a respective [ y ] sublist of Points to test and receive the Indicies of which points lie in which polygon.

Below is a working example when it is just one list and not a multiple number of sublists:

If the List of “Polygons” grows another level:

image

and the List of “Points” grows another level:

How do I test which [0] Points lie in [0] Rectangles and [1] Points lie in [1] Rectangles?


#2

Not sure is the best way, but you can try something like this:

The node becomes yellow because the list of points have different items, so you may get some null values. But it should work.


#3

Never knew why this worked, just know that it works :stuck_out_tongue: (again, thanks @Vikram_Subbaiah)


#4

Thanks @mellouze and I suppose more importantly @Vikram_Subbaiah who led you to the answer.
Also @lucamanzoni I appreciate your answer! Cool to see transpose used for this example.

The use of the code block seems to work as intended! This brings up a few more questions but I’ll probably have to start a new thread for those. Thanks to all who supported!