Importing ASCI data from 3D scan

Hi,
today I went to a sport university, and they are able to make full body 3D scans. So they made a quick scan (15sec) of my body. Unfortuanatly they can only provide an avi (youtube link) of the scan or a huge ASCII file (12 mb) of all the scanned points. It looks like this:

926.0 -66.9 33.7

922.4 -65.3 38.6

922.4 -65.9 36.9

918.8 -64.3 41.3

918.8 -64.8 39.9

918.8 -65.3 38.5

915.2 -64.1 41.9

915.2 -73.3 36.5

911.6 19.0 40.3

Does anyone know how to import it to blender and create a mesh out of it? It would be really great! thanks!

Looks like they’re just coordinates of a “pointcloud”, shouldn’t be hard to make that (if you know some python)… making it into a solid mesh is tricky though.

mmm… I would prefer to have a solid mesh, but any hint how to create a point cloud from an ASCII file (.asc) in phyton would be also nice… The wired thing is they could already show me the solid mesh (see the youtube video), but couldn’t export.

You need a script to read in the file and add the verts to a mesh.

Something like:


import Blender
from Blender import Scene, Mesh

filename='/home/ian/file.txt'
data=[]
for line in open(filename):
	line=line.rstrip("
")
	temp=line.split()
	data.append((float(temp[0]),
			float(temp[1]),
			float(temp[2])))
								
me = Mesh.New('point cloud')
me.verts.extend(data)
Scene.GetCurrent().objects.new(me,"pointcloudob")
Blender.Redraw()

Should work, tested on the data you gave (although I removed the extra lines)

You should add some error handling, but it’ll work generally (on a windows machine, may need to add line=line.rstrip("\r") after the line=line.rstrip("
")).

have you tried the read raw-face data import/export filter?

it reads/writes a raw list (editable by a normal pure-text-editor) of the points of every face with 2 to 4 mvertices out.

The only thing you have to do is to change the input data in a way
that you have a minimum of 3 points on a line.

Your data looks like 3 points are always very close together.

the easiest way to get an idea how to make it look like is to
select the default cube-object and export this as raw-faces-data
and look into the output-file with a text-editor,
then you only need a routine to put 3 lines of your point-data on one line together.

Hi,
thanks for the help, but I had problems with both methods.

With the script it creates the object without any vertices. It gave no errors, so I don’t know what I did wrong…

Importing as RAW did also not work. It seems that RAW files only work with faces. I tried to export only one vertex, to see hoe the file is written and the file was empty. Only if I exported a face with at least 3 vertices the RAW file has content. But in my ASCII file I don’t have faces.

So if sombody knows a method, to create a surface out of a point cloud written in an ascii file, please tell me…

If you want to see the ASCII file with the first 20000 point go to Scan_20000.asc

thanks!

Works for me, cool scan btw.

You may not have seen it as your points start at x=900 so pan to the right, or

import Blender
from Blender import Scene, Mesh

filename='/home/ian/file.txt'
data=[]
for line in open(filename):
	line=line.rstrip("
")
	temp=line.split()
	data.append((float(temp[0])-900,
			float(temp[1]),
			float(temp[2])))
								
me = Mesh.New('point cloud')
me.verts.extend(data)
Scene.GetCurrent().objects.new(me,"pointcloudob")
Blender.Redraw()

It’s also really big so you’ll have to zoom out.

Oh, you are right! It was just very big… thanks! Now I have to figure out how to make it solid! But this is already quiet cool!

Accutrans imports XYZ-data: http://www.micromouse.ca/xyzfiles.html If i’m right, it converts to a solid mesh.

There is a python script that skins a mesh from the data (makes faces). search python forum…point cloud. Started as making an IPO from csv data. Search for CSV Cloud. This forum does not allow images, but I ran it and it works, although a lot of data is missing (half his face), and the digital scan does not really allow for edgelooping, although it is an interesting technical exercise.

Well I tried the script offered here with our Laser scanned oil refinery data in the office and to my surprise it worked extremely well.
I am very new to Python and was failing to get a useable script, so luckily this worked.

Now I have the points in the scene, what I am hoping to end up with is a model of points that always render at 1pixel size.
I have used Halo to render them but the points render at different sizes according to the distance from the camera.

Is it possible using blender and python. Right now the points only render if I use Halo, and do not show using anything else.

Any Ideas?

Hello,

I just started working with Blue Coats, running a set of SGs with a set of AVs. To be able to better judge some long file scan times I would love to see some common values.

I have to admit that I’m not sure, but they seem to be 810-B-CS running 3.2.2.1.

Is there a collection of scan time data for various ProxyAV models?

Hello.

I’m new to Blender, but I have some experience in 3D with some other software.
Now I’m trying to use script offered above and… can’t do anything.
I’ve figured out that Blender is not using Blender module anymore.
Can anyone rewrite this script for Blender 2.5-2,6?

Thanks!