Changed method for generating subdivided triangles from a recursive to
an iterative one.