Note
Go to the end to download the full example code.
Use a PyVista Qt backend#
PyVista Qt is a package that extends the PyVista functionality through the usage of Qt. Qt applications operate in a separate thread than VTK, you can simultaneously have an active VTK plot and a non-blocking Python session.
This example shows how to use the PyVista Qt backend to create a plotter
import pyvista as pv
from ansys.tools.visualization_interface import Plotter
from ansys.tools.visualization_interface.backends.pyvista import PyVistaBackend
Open a pyvistaqt window#
cube = pv.Cube()
pv_backend = PyVistaBackend(use_qt=True)
pl = Plotter(backend=pv_backend)
pl.plot(cube)
pl.show()
Parallel VTK window#
Close the pyvistaqt window#
pv_backend.close()
Total running time of the script: (0 minutes 1.482 seconds)