Hello!
Can vtk.js render unstructured grid data independently (i.e., without relying on vtk python as a backend or another tools beyond the scope of vtk.js)?
If not, are there any plans to add this capability?
Thank you in advance.
Hello!
Can vtk.js render unstructured grid data independently (i.e., without relying on vtk python as a backend or another tools beyond the scope of vtk.js)?
If not, are there any plans to add this capability?
Thank you in advance.
No, VTK.js does not support unstructured grid.
There is no short term plan to add such capability.
You might want to consider VTK.wasm instead.
Thanks for your reply!
Speaking of VTK.wasm, is it possible to somehow combine it on client side with vtk.js+react? Perhaps there are any examples?
And is the option you suggested better than using vtk.js+react as a frontend and vtk+python as a backend (the operation to turn unstructured data into structured data will take place on the server and then sent to vtk.js to display)?
it possible to somehow combine it on client side with vtk.js+react? Perhaps there are any examples?
Yes. it is possible. Using WebAssembly - VTK documentation
Examples are not React related.
And is the option you suggested better than using vtk.js+react as a frontend and vtk+python as a backend (the operation to turn unstructured data into structured data will take place on the server and then sent to vtk.js to display)?
Use trame. Supporting unstructured data is built-in.
Hello, I am trying to address a similar problem (i.e. use vtk.js
for the frontend and Python for the backend). I had in mind the example of pyvista
and mesh visualization in a jupyter notebook using trame
. I am trying to achieve something similar to GitHub - pyvista/pyvista-fastapi-webapp: Demo FastAPI and Three.js application using PyVista but to visualize data from an unstructured mesh interactively in a web application.
Use trame. Supporting unstructured data is built-in.
Would you mind to explicit how to use trame
in this case? I thought about using trame
to generate a view of a mesh (typically unstructed grid stored as *.vtu) to be rendered on the client side using vtk.js
.
I understood trame
as a framework to build an entire web application with Python. Because the intended web application does more than the visualization with vtk, I don’t want to rely on trame
for the whole application.
You can use trame “just” for the 3D view and not the web application. In such case, it is a simple iframe within your whole application
Thank you for your answer. With the js-trame example of trame-iframe
was able to do what I wanted.
is iframe efficient
An iframe does not bring any performance impact when it comes to interactive visualization.
thanks for clarification
I’m trying to create a VSCode extension to visualize .vtu files. Since VSCode doesn’t support iframes (it uses its Webview API), I’m struggling to find a lightweight solution.
Trame with Python works, but it would either make the extension too heavy (bundling Python) or too complex (requiring a user setup). I also tried WebAssembly but ran into many errors, probably due to my inexperience with it.
Any ideas for a simpler approach?
Hello @Daniel_Lopez,
I agree that bundling python would make your extension heavyweight. What kind of errors did you run into? Please share relevant logs, code, github repo, etc…
refer the cfd-toolkit library from npm it works already. if you get any error you could ask me.
Hi @sridhar-mani,
Thanks for the reply. Your approach (similar to this vtk.js) is turning a vtu into a “shell” using vtp writer is not enough for what I need, because you basically lost all the cells and just plot a shell. Thanks anyway. I think is what ITK.js also offer as a workaround.
Thanks Jas, I’m preparing the files.
If you don’t want to build your own WASM app, you should be able to use vtk3d for what you aim to do.