[Paraview-developers] Reader for point cloud stored on custom binary file

David E DeMarle dave.demarle at kitware.com
Fri Apr 22 10:35:02 EDT 2016


You can turn your python programmable source into a standard reader. Then
you don't have to edit the script manually as File->Ooen will know how to
use it.

For details:
http://markmail.org/thread/2pnrmzkbx5n2u3ke

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909

On Fri, Apr 22, 2016 at 10:15 AM, Favre Jean <jfavre at cscs.ch> 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
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Search the list archives at:
> http://markmail.org/search/?q=Paraview-developers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20160422/4fe2809b/attachment.html>


More information about the Paraview-developers mailing list