How can I connect triangles' points but with closed polylines?

Hi !
I have a collection of points that I need to connect with closed polylines, according to the image. Can someone explain to me how to do such a GrassHopper script ? I’m new to grasshopper… Thanks!

3. Attach minimal versions of all the relevant files