[Bf-python] Question to surface-script

Thomas Bleicher tbleicher at arcor.de
Sun Dec 25 16:20:09 CET 2005


On 25.12.2005, at 13:40, Thomas Buschhardt wrote:

Hi, and happy christmas as well.

> Hallo,
> I need a little bit help. I have a ASCII-file with 3D-coordinates of 8
> mil. points (vertexes). I put these points in blender. Now my problem:
> It's possible with an internal method of blender or a cool
> script/function to make a surface (like a landscape)?

I don't know about an internal method (and I doubt its existance).

It's simple if your vertices are on a regular grid:

IIRC there is a limit for Blender meshes of 64k vertices. So you will
have to divide your 8 mil. points in smaller patches and create  
individual
mesh objecs out of these.

I have not done this for a long time so the details of the API may have
changed but in pseudocode for each patch the sequence would be:

mesh = NMesh.New("patch_x_y")

patch = []
for row_data in patch_data:
     row = []
     for x,y,z in row_data:
         v = NMesh.Vert(x,y,z)
         add v to mesh # ??
         row.append(v)
     patch.append(row)

for y in range(len(patch)-1):
     for x in range(len(row)-1): # all rows of same size!
         v1 = patch[  y][  x]
         v2 = patch[  y][x+1]
         v3 = patch[y+1][x+1]
         v4 = patch[y+1][  x]
         face = NMesh.Face([v1,v2,v3,v4])
         add face to mesh # ??

mesh.update()

I don't know about the "# ??" lines but you should find examples how
to add face and vertices in other scripts. I do remember a script
to import geographic data files but I can't remember the URL, sorry.
Look around in the scripts sections of elysiun.com.

If you don't have data as an x-y-grid you will have to work out how
to create triangles or quad faces first. This will be more complicated
than the mesh creation itself.

Thomas



More information about the Bf-python mailing list