[Bf-python] Point clouds

Kris Nackaerts knackaerts at gmx.net
Wed Mar 24 09:58:56 CET 2010


Dear,

I'm trying to read point cloud data (X Y Z R G B). As vertices it works great, but whar can I do with vertices with respect to visualisation? I've no experience with particles yet, coud this help and define vertices as particles?

So, I try to add a small pyramid to each location, but Blender seems not to be able to handle it. Well, I believe it has nothing to do with Blender, but with my (simple) script.

In short, it looks like: 

def makeCone(x,y,z,name,passedMesh,passedScene):
	ob = Object.New("Mesh",name)
	ob.LocX=x
	ob.LocY=y
	ob.LocZ=z
	ob.link(passedMesh)
	passedScene.link(ob)
	return ob

_files=['d:\\temp\\points_0_%i.asc' % (i) for i in range(11)]

for file in _files:
	print 'Processing %s' % (file)
	xyz = open(file, "r")
	line = xyz.readline().split(',')
	while len(line)==6:
		x,y,z,r,g,b = [float(q) for q in line]
		newpoint = Mesh.Primitives.Cone(3, 0.01, 0.01)
		point = makeCone(x,y,z,"pt",newpoint,cur)
		line=xyz.readline().split(',')
	cur.update()

izeZ=0.2
print '# Done'


One file contains 5000 locations and runs fine, when starting file 2, the system begins to slow down dramatically. In total I have 50000 points, reading them as vertices is really quick, no problem.

I've set UNDO to 0 and also switched off the global undo. Any other thaughts?

I assume I'm doing something wrong (it's my first Blender-Python usage)? (Windows XP; 2Gb RAM; Blender 2.492)

-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01



More information about the Bf-python mailing list