from Blender import * import math import sys xres = 10 yres = 10 xscale = 1 yscale = 1 mesh = NMesh.New() row = [] for y in range(yres): col = [] row.append(col) for x in range(xres): vert = NMesh.Vert(x,y,0) col.append(vert) mesh.verts.append(vert) print len(mesh.verts) for y in range(yres-1): for x in range(xres-1): print x,y, 'asa' topleft = row[x][y+1] bottomleft = row[x][y] topright = row[x+1][y+1] bottomright = row[x+1][y] face1 = NMesh.Face([topleft, bottomleft, bottomright]) face2 = NMesh.Face([topleft, topright, bottomright]) mesh.faces.append(face1) mesh.faces.append(face2) NMesh.PutRaw(mesh)