[Paraview-developers] Reader for point cloud stored on custom binary file
Favre Jean
jfavre at cscs.ch
Fri Apr 22 10:15:13 EDT 2016
my suggestion would be to use some more numpy-oriented features. Your "points" array is already a numpy array, you can feed it to the vtkPolyData with a simple reshaping. Same for your reflectance array. No need for a for-loop
I'd replace your code with this:
filename = "worked.bin"
points = load_velodyne_points(filename)
N=points.shape[1]
# use "output" as the pre-defined vtkPolyData object
output.Points = points[0:3,].reshape(N, 3)
output.PointData.append(points[3,], "reflectance")
I usually skip building up cells, because I use a PointGaussian representation mode. But your needs might differ. Anyway, with the changes above, I can read all 3 files without any problem.
-----------------
Jean
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20160422/48698107/attachment.html>
More information about the Paraview-developers
mailing list