[Paraview-developers] Reader for point cloud stored on custom binary file
Ellon Paiva
ellonpaiva at gmail.com
Mon Apr 25 15:35:27 EDT 2016
I decided to follow your advice and installed paraview 5.0.1 from
source. The code seemed to work, but I don't see any point in the
screen. I can see in the information tab that all points were loaded,
but the vtkPolyData has zero cells. How can I add the the points to
cells? Specifically, I would like to have one point per cell.
Ellon
On 04/22/2016 04:15 PM, Favre Jean wrote:
>
> 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/20160425/5afe32fc/attachment.html>
More information about the Paraview-developers
mailing list