vtkjs

The export module privides a few macros for exporting data scenes within ParaView’s rendering environment to the VTKjs format.

Export VTKjs

pvmacros.export.vtkjs.exportVTKjs(FileName='', compress=False)[source]

This function will execute a script to export the current scene from your rendering into the VTKjs shareable file format.

Parameters:
  • FileName (str) – Use to specify the basename of the output file. Extension will always be ‘.vtkjs’
  • compress (bool) – Declares a preference to compress the data arrays. Defaults to False.
Returns:

Prints the path to the saved ‘.vtkjs’ file.

Return type:

None

Note

  • To view, open the file in the VTKjs standalone web viewer found here
  • Use the get_vtkjs_url.py script in the PVGeo repository to get a shareable link for the exported file.

Get VTKjs URL

pvmacros.export.vtkjs.getVTKjsURL(host, inURL)[source]

After using exportVTKjs() to create a .vtkjs file from a ParaView data scene which is uploaded to an online file hosting service like Dropbix, use this method to get a shareable link to that scene on the PVGeo VTKjs viewer.

Current file hosts supported: - Dropbox - GitHub

Parameters:
  • host (str) – the name of the file hosting service.
  • inURL (str) – the web URL to the .vtkjs file.

Example

>>> import pvmacros as pvm
>>> # A Dropbox hosted file:
>>> pvm.export.getVTKjsURL('dropbox', 'https://www.dropbox.com/s/6m5ttdbv5bf4ngj/ripple.vtkjs\?dl\=0')
>>> # A GitHib hosted file:
>>> pvm.export.getVTKjsURL('github', 'https://github.com/OpenGeoVis/PVGeo/raw/docs/ripple.vtkjs')