Polyline by list of point without intersection

Hi everyone, I have a problem with a grasshopper script that I can not solve.
I have a list of points formed by sublists of 6 points each. I would like to model a polyline passing through these points that takes into account the proximity between these, so I would like to model a polygon without intersections because these points are arranged on the sides of a hexagon.
Anyone can help me