Kitware / vtk-js

Visualization Toolkit for the Web
https://kitware.github.io/vtk-js/
BSD 3-Clause "New" or "Revised" License
1.24k stars 373 forks source link

Local rendering + vtkWeb server #1376

Closed esalehim closed 3 years ago

esalehim commented 4 years ago

Hi,

I'm trying to use vtkWeb as a data processing server but do the actual rendering on client side with SynchronizableRenderWindow.

I'm aware that SynchronizableRenderWindow could work with ParaView backend (via ParaViewWebLocalRendering Protocol), but similar api is missing in vtkweb. Is there a way to make it work? I'd like to stick with vtkWeb since I have my code in pure vtk

Thanks

jourdain commented 4 years ago

You "just" need to provide the missing server side RPC which should be fairly easy to do if you use the ParaView version as reference. https://github.com/Kitware/ParaView/blob/master/Web/Python/paraview/web/protocols.py#L908-L1001

esalehim commented 4 years ago

Thanks for your reply @jourdain!

That's what I actually did. With some minor changes I've managed to replicate the missing api in vtkweb. Now I'm able to deliver the geometry (points+lines) but for some reason scalar arrays are not delivered! I'll do some more troubleshooting and will let you know.

I was also curious to know: 1) What is the motivation for vtkWebViewPortGeometryDelivery class then?! Is there any client side (vtk.js) component that matches this?

2) Is it possible to use geometry delivery in mpi parallel mode? using either paraview or vtkweb backend? I tried that with pvbatch and I get a crash at pushGeometry

3) In general is there any other benefit for choosing paraviewweb over vtkweb server?

jourdain commented 4 years ago
  1. It is the legacy one that we don't use anymore. But left for compatibility reason.
  2. Yes, but you need to force "rendering" to happen on process 0 by tuning some rendering threshold.
  3. ParaView provide a higher level API (easier to code on server side) and provide natural support for MPI.
jourdain commented 4 years ago

If your code is fairly limited and you already have "all" of it in VTK, it might be just fine to use the VTK approach.

agirault commented 3 years ago

Closing this issue. If you still need help, please ask your question on our discussion forum: https://discourse.vtk.org/c/web/9