On this page, we demonstrate how to quickly share a 3D rendering of your ParaView visualizations with anyone who has access to the internet so that that can explore the whole scene in a dynamic manner.
In order to effectively communicate our geoscientific findings, we often need to share our 3D visualizations with interested stakeholders. These interested parties are likely not going to have ParaView or other visualization software at hand. Thus we desire to have a means to export our complex visualizations in ParaView to a simple, shareable format that anyone can view. To accomplish this, we will take advantage of vtk.js and its standalone web viewer for vtk.js formats.
Would not it be great to send your client or interested parties an interactive 3D scene of your Geophysical findings like the example below?
vtk.js is a rendering library made for scientific visualization on the web. This code base brings high performance rendering into anyone’s web browser. This library allows us to export complex scenes from ParaView and share them with anyone that has a web browser like Safari or Google Chrome.
The vtk.js library has an open-source standalone scene viewer which they have a nice demo. The first link can either be downloaded as an HTML file to be ran locally, or you can go to that link and run from the vtk.js server. vtk.js also published a scene export macro for ParaView that compresses a data scene in ParaView to a shareable format for viewing on the web. The macro from the vtk.js library can be used but we also deploy an updated (we think more robust) version of this export macro in the sub-module export of our Python module pvmacros.
First, make a complex scene in ParaView that you might like to share with someone.
Now that you have your scene loaded, open the python shell from’View->Python Shell’
(or ‘Tools->Python Shell’ depending on your ParaView version) within ParaView.
From here, import our Python module delivered in the repository called
#!py pvmacros. From the
#!py export sub-module, there is a function called
#!py def exportVTKjs() which takes two optional arguments (FileName string
and compress boolean). Execute this function and note the output text as it
will describe where the exported scene was saved.
## Import our ParaView Macros module: import pvmacros as pvm ## Now run the exportVTKjs script from the export sub-module pvm.export.exportVTKjs(FileName='test_export')
Now open the standalone web viewer by opening viewer.pyvista.org
Select the exported scene as the input file for the web viewer from where you
saved it (should be under
~/Dropbox/PVGeo_vtkjs/). The export macro should
have printed out the location of the saved scene in the Python Shell.