You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
would it be possible to create a JSON containing a Polydata on backend server (running vtk through a Python script) and send it to vtk-js directly (using a json.dumps on server side) ?
When trying ot use it, I get this response : Object of type 'vtkPolyData' is not JSON serializable
Thanks a lot
The text was updated successfully, but these errors were encountered:
They are several way to do that. JSON is obviously one but not necessary the best one.
A better one could be using the vtp format to send a single binary blob over the network and use the XMLPolyDataReader on the vtk.js side.
If you use VTK and Python, you can use a synchronization mechanism that we rely on inside ParaView Visualizer to do local rendering. In that set up we inspect a RenderWindow and extract each actor geometry. We provide a scene descriptor in a JSON format and then the client request the various bits of arrays (coordinates, cells, fields) as binary blob. But this imply a more complex and connected relationship between the server and the client.
If JSON is your way to go, you can create a JSON format in Python that can be understand by vtk.js like described here.
Just provide a normal JSON array in the values field. When used with the vtk() function on the client side, such JSON will be converted to a vtkPolyData instance.
Hello,
would it be possible to create a JSON containing a Polydata on backend server (running vtk through a Python script) and send it to vtk-js directly (using a json.dumps on server side) ?
When trying ot use it, I get this response : Object of type 'vtkPolyData' is not JSON serializable
Thanks a lot
The text was updated successfully, but these errors were encountered: