[Paraview] Vectorized data assignment

Christian Gabriel cgabriel at matrix-solutions.com
Mon Nov 7 09:00:30 EST 2016


Good day.

I found this example code<http://www.paraview.org/Wiki/VTK/Examples/Python/GeometricObjects/Display/Cell3DDemonstration>:

    # Create the points
    points = vtk.vtkPoints()
    points.InsertNextPoint(0.0, 0.0, 0.0)
    points.InsertNextPoint(1.0, 0.0, 0.0)
    points.InsertNextPoint(1.0, 1.0, 0.0)
    points.InsertNextPoint(0.0, 1.0, 0.0)
    ... ... ...

which had me wonder if there is a way to assign data in a vectorized fashion instead of point by point?

Let's say I can read in 3 1D arrays (vectors) with X, Y, Z data or one 2D array (matrix, dataframe) with the same data in columns, is there a way to assign that data to the points all at once instead of iteratively?

    points = vtk.vtkPoints()
    points.InsertNextPoint(X, Y, Z)    - just saying; this is obviously not correct!

Obviously, any data could be combined and reshaped first to whatever format required ....

Given that ParaView/VTK was designed to work with (very) large data sets I'd be surprised if there were no vectorized operations implemented.

Thanks, Chris

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20161107/0fdfc101/attachment.html>


More information about the ParaView mailing list