-
Notifications
You must be signed in to change notification settings - Fork 26
Description
Description
Hello,
I am trying to handle around 100 to 200 GeometryRepresentations in a vtk view. Each representation is defined by around 200 points.
At some point I update the positions/orientations of the representations and generate a new mesh state with the "to_mesh_state" method in a callback.
I found out that the slowest method in the chain is the following and all following methods like GetStrips():
dash-vtk/dash_vtk/utils/vtk.py
Line 98 in d888a15
| points = b64_encode_numpy(vtk_to_numpy(polydata.GetPoints().GetData())) |
It is the GetPoints() method, not the vtk_to_numpy or encode method.
A topic which was already discussed here:
https://discourse.vtk.org/t/faster-method-for-getpoint/3189
and
https://discourse.vtk.org/t/what-is-best-way-to-get-the-highest-point-z-axis-in-a-polydata/1833/5
For one representation it takes around 40-80ms to get the points. When I have many representations, it gets very fast, very slow. Unable to animate anything.
Solution 1:
I combine all my polydata into one vtkAppendPolydata and create only one GeometryRepresentation. But then I have no possibility to select individual polydata/representation. If I would have access to the renderer/interactor/picker or at least the cellid within the click callback, then I could manage to get the selected polydata through global ids on vtk side.
Solution 2:
More efficient way to transfer the data from vtk to dash? Other method the GetPoints...etc.
Solution 1 seems to me more feasible. Is there a possibility to access the renderer/interactor/picker and/or cellid in the callback?
Thank you very much!