generating triangles from a grid of points