Excel Coordinates >> Point Cloud >> 3D Mesh, need help


#1

I tried looking at old topics, but couldn’t quite find the right help (probably because I’m a huge newb with the specifics of what I’m doing).

Basically, my office has given me a task of bringing a 14 million coordinate excel file (each coordinate with RGB values as well, so the rows look like:

X coordinate, Y coordinate, Z coordinate, R value, G value, B value

The data was created by a 3D environmental scanner. I know how to save the coordinates out as comma separated text files, and I have my programmers helping me figure out how to best divide the data.

But I want to know how to best bring the coordinates into 3Ds Max (currently using version: Design 2009). I heard something about point clouds and then converting that into a mesh. The data-points are fairly packed together, if that helps.

Please know that I am not a max-scripter at all (and am not sure if the programmers I will be working with are either).

So any help bringing this Excel file to a 3D mesh is very appreciated.


#2

Hi,

It’s faily easy to build a mesh with those vetex coordonates and colors.

BUT, I don’t think there is a way to build the faces from those verts.
I never heard of of a point cloud to mesh converter.

You’re pretty much stuck with the point cloud, as i don’t imagine building millions of faces manually.


#3

i think you have to look at some 3d laserscanner companys like Rigel or Callidus.
I know that they can convert pointclouds with RGB information.
Some application to generate a mesh from pointcloud: Polyworks, QTSculptor, aSpect3D, …
I think that the large amount of points requires such an application. why dont you ask a 3d laserscanning company to convert the pointcloud for you?
I have worked about 3 jears for ArcTron in Germany and we used Riegel Scanners. I know that the convertion of the pointcloud to a mesh is not much work if you use the right Application.


#4

If there is third party software that is the way to go as it would be far faster then scripted solutions.

I was thinking about how this can be done though nad on terrain I think that it would be possible to write a script that could work it out. Terrain data like that would be flat for the most part and wouldn’t have faces that curve back on them selves like in a character mesh. So I think that you could do some searching and determine if a face should be built or not from any three verts. If the face that it would build would create an over lap on another then don’t build it.

Some think like.

Build Oct tree of verts.

Start with first vert and collect all verts in a spherical area around that vert for a given distance. If there are two or more start building faces if not increase search radius and try again.

Take the two closest verts and calculate the triangle and the face normal for it and fire rays up and down from that face normal to see if you hit any other faces that have been built. If no hit build face.

Of course there would be cases where hits would happen and should be egnored and some allowence could be built in for that like a distance check. If it is over a certain amount egnore it.

This sort of thing could work, but I’m guessing it would be very slow with Max script and millions of vets.


#5

there are many apps that can do this (Pointcloud->Mesh) in the CAD arena…

one of the cheaper packages…
http://www.sycode.com/products/point_cloud/index.htm

it has even a 10 times / 10 days fully functional trial period, so it might solve your specific problem in that time… :wink:

for an open source implementation:

http://meshlab.sourceforge.net/


#6

Hi

I’ve done this several time with seabed scans around oil rigs.

Rather than try to create a mesh from the points, it’s easier to create a flat mesh by hand of the correct size and with the correct number of x and y co-ordinates and then use maxscript to move the verts up or down to the right position.

You need to look at the data in a spreadsheet and work out the size of the scanned area and the spacing of the x,y data. Create a flat mesh of the correct size which has the same number of vertices as lines of data. Once you’ve done this you no longer need the xy data in the spread sheet just the z value and the order that the data is listed in.

Have a look at your data it’ll probably start in one corner and the list of co-ordinates will run row by row until you reach the opposite corner. The Vertex numbers of the mesh work the same way. Edit the data in a spreadsheet so that you have 2 columns, the first is the vertex number the second is the z value.(this is not easy, and you’ll need to fiddle around with the data untill you get it in a form you can use). The resultant file will look a bit like this:

14 32.82
15 32.84
16 32.88
17 32.85
18 32.82
19 32.82
20 32.82
21 32.82
22 32.85
23 32.82
24 32.81
25 32.81
26 32.81
27 32.81
etc…

Then all you need to do is write a script that will read the first value in the text file and move the first vertex of your mesh to that position, then repeat a million or so times (it dosn’t take that long).

Here is the script that I used (I AM NO GOOD AT MAXSCRIPT!!) it’s as rough as a badgers arse but it worked, I’m sure that there are things in there that could be much better, for example the names of the mesh and the text filename are hard coded as I don’t know how to code file open boxes or object selectors.


global my_filename
global myfile
global myobj = $seabed_4
global myvert = [0.0, 0.0]
global xRead = 0
global zRead = 0
global myvertpos

my_filename = “part4_text_data.csv”
myfile = openfile my_filename

while (not eof myfile) do
(
xRead = readvalue myfile
– this is the vert number

    zRead = readvalue myfile
    -- this is the z value or height
    
    myvert = xRead
    myVertpos = getvert myobj myvert
     
     myVertpos.z = zread
     setVert myobj myvert myVertpos
    -- set z position vert
    )
    
    
    update myobj

It may well be that you have far too much data to handle in one lump in which case just cut it up into strips and weld it all together afterwards.

I’ve no idea how to set the vertex colours but once you get the mesh created I’m sure a similar technique would work.

Cheers
Garry


#7

Make sure you use with undo off command! or it’ll never get anywhere!


#8

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.