# Cartesian product only between two sublists (level 3)

Hello, after some hours of heavy brainwork I have a huge node in my brain and I cannot find a way out. I googled around, I’ve found topics like (How to use List.CartesianProduct at @L3), but I couldn’t figure it out just using nodes, not using designscript or python yet. I hoped to find a solution using nodes only (mainly to understand Dynamo).

The case (just for your understanding): I have a couple of closed polylines, and I want to lay a 1-meter-raster of points over their boundingboxes. In my opinion its a classical usecase for cartesian product between all the xmin…xmax…1 and the ymin…ymax…1 of the polygon’s boundingbox. It works great with a single selected polyline using Point.ByCoordinates(x,y) and lacing with cartesian product, but unfortunately not with a set of selected polylines because all the x-values of polyline 1 are getting combined with all y-values of polyline 2, too. I had several tests the List.CartesianProduct. I attached a small sample to demonstrate what I desire to and what I’m just receiving.

Maybe, there is enyone to lead me into the right direction.
Regards, Fred

Hi, to be more clear: I’m looking for a “node-version” of the following code.

``````inputList;
resultList=[];

t = [Imperative]
{
for(i in inputList)
{
subList=[];
for(x in i[0])
{
for(y in i[1])
{
}
}
}
return = resultList;
};
``````

(inherited from List combination, Cartesian - #13 by Vikram_Subbaiah)

With regards, Fred

Hi,

This is so far i can got, for small project or it depends on how much you can type and duplicate node :D.
Tell me your thoughts if any.

Best regards.

Vào CN, 4 thg 9, 2022 vào lúc 21:19 Fred via Dynamo <notifications@dynamobim.discoursemail.com> đã viết: