List of lists lacing

I’m checking if a list of points exists inside a list of polygons for this I’m using cross product lacing. This works fine if my two lists have only one level. However, if the input lists have more than one level (i.e. list of lists) then I’m not getting the results that I need. I need to check all points of a sub-list with every polygon of the same sub-list.

For this example I have a list containing 4 Sub-list each sub-list with 1 + 6 + 6 + 4 = 17 polygons. Similarly, the point list has the same structure. My result should be a list with 4 Sub-list with 1²+6²+6²+4² = 89 bool values:

Does anyone know what node will do the trick? I was trying list.map and loop but I had no luck.

Set the list levels of the polygon containment test to @L2 as a first step. :slight_smile:

I did try that but I did’t get the expected number of results.

Sorry - should have been more clear. Both inputs will need the levels adjusted here.

Still getting 51 outputs. Am I doing something wrong?

@MCC Here is how you can do it with Design Script.
(I prefer Replication Guides to struggling with Levels and Lacing in nodes)


plg<1>.ContainmentTest(pnt<1><2>);

2 Likes

Vikram,

That Worked! Thanks!

Can you explain the syntax?
I don’t understand why Jacob’s solution worked and your’s did.

1 Like

I don’t consciously understand the technicality of replication enough to be able to explain it.
The section on Replication and Replication Guides (page 26) in the Design Script Guide might help you understand.
Don’t bother if it doesn’t help clarify though. I’ve never read it myself, but still manage to use it :stuck_out_tongue:

I also explain a bit on Replication here: https://github.com/Amoursol/dynamoDesignScript/blob/master/DesignScript_ARobustDiveIntoTheLanguageUnderlyingDynamo_BILTEUR_Ljubljana2018.pdf :slight_smile:

1 Like