How to generate a triangular grid from a list of points?

Try this:

R = DelaunayMesh[h[0, 0, 2]]

enter image description here

You may grab the edge indices with

MeshCells[R, 1]

Your code wasn't far off, though the other answers may be more elegant.

This works:

L2[x_, y_, n_] := Module[{pts},
  pts = h[x, y, n];
  Show[Graphics[{
     Point[pts],
     Table[
      If[EuclideanDistance[pts[[i]], pts[[j]]] == 1, 
       Line[{pts[[i]], pts[[j]]}]], {i, Length[pts]}, {j, Length[pts]}]
     }]]]

L2[0, 0, 2]

enter image description here


You can use NearestNeighborGraph as follows:

Line[{##}] & @@@ EdgeList@NearestNeighborGraph[h[0, 0, 1]] // Graphics

enter image description here