Create surface from array of points

Hello everyone,

I’ve created a script that generates a random array of points (see image) to define different column layouts. Now, I want to create floor surfaces between every set of four points where possible (like the black squares in the image). These surfaces need to be individual, as I intend to use them in Karamba to calculate the displacement of each beam resting on the columns.

The challenge I’m facing is that I’m not sure how to achieve this. I assume that the points need to be arranged in a specific order before using the “4Point Surface” function, but I’m not very experienced with data structures. Any guidance or advice on how to approach this would be greatly appreciated!

Thanks in advance!

GH file is in millimeters
surface_problem_2_4_25.gh (7.4 KB)

There are many different approaches. Here are a couple of options:
surface_problem_2_4_25_v2.gh (15.2 KB)