What algorithm that could used for generating mesh from xyz coordinates? If the input is xyz dataset and the output is order of points to connect

Suppose I have a set of xyz coordinate S = {(x1,y1,z1), ... ,(xn,yn,zn)}, and the algorithm that I looking for will return a set A of number of S’s element index that represent the order to connect the xyz coordinates.

For example:

If S = {(0,1,1), (1,4,3), (6,0,1)}, and A = {(0,2,1)}

It means that point x1(0,1,1) will first connect to x3(6,0,1), then x3 will connect to x2(1,4,3).

I’d like to implement it for mesh generation program like one in Blender. So, the output set A must connect the points in S that will form a closed surface.

Mesh generation from xyz point in blender: enter link description here