Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can BackgroundPlotter refresh and redraw in a loop? #595

Open
rruixxu opened this issue Jul 10, 2024 · 0 comments
Open

Can BackgroundPlotter refresh and redraw in a loop? #595

rruixxu opened this issue Jul 10, 2024 · 0 comments

Comments

@rruixxu
Copy link

rruixxu commented Jul 10, 2024

I just want to draw a sequence of different mesh and implement it in a loop by BackgroundPlotter. But I have tried my best to figure out how to do that.
In the following code, I have to place plotter.app.exec_() at the end of the loop to realize interactive zoom in and pan. However, the window will not go on to the next iteration. I tried to place input() or sleep() at the end of the loop, but making window non-interactive then.
I just want to simulate the window behavior of opencv which can block the iteration util I press some keys or util certain time. How can I do that?

import pyvista as pv
from pyvistaqt import BackgroundPlotter

sphere = pv.Sphere()
scale = 2

plotter = BackgroundPlotter()
for i in range(4):
    plotter.clear()
    sphere.points *= scale
    plotter.add_mesh(sphere)
    plotter.app.exec_()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant