[cgkit-user] Pointcloud error
Brought to you by:
mbaas
From: Nick D. <nic...@gm...> - 2012-09-30 10:22:20
|
Hey, I tried loading a ptc with the example code: from cgkit.cgtypes import * from cgkit import pointcloud import numpy ptc = pointcloud.open("test.ptc", "r", "3delight") buf = numpy.zeros(shape=(5, 7+ptc.datasize), dtype=numpy.float32) ptc.readDataPoints(5, buf) But I get this error: Traceback (most recent call last): File "C:\ndPtc\ndPtc.py", line 7, in <module> ptc.readDataPoints(7, buf) File "C:\Python27\lib\site-packages\cgkit\pointcloud.py", line 325, in readDat aPoints pntPtr = _arrayPointer(buffer, pntStride*numPoints) File "C:\Python27\lib\site-packages\cgkit\pointcloud.py", line 83, in _arrayPo inter raise TypeError("Unsupported array type (data pointer is not an int)") TypeError: Unsupported array type (data pointer is not an int) Any ideas? I have no problems with this: for p in ptc.iterPoints(): print p But it seems using Numpy arrays will give me a speed boast. Cheers, Nick Deboar |