Skip to content

Slow mesh state update, lack of access #70

@m-vik

Description

@m-vik

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():

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions