pyvista / pyvista-support

[moved] Please head over to the Discussions tab of the PyVista repository
https://github.com/pyvista/pyvista/discussions
59 stars 4 forks source link

autozoom, autofocus #491

Closed nschloe closed 2 years ago

nschloe commented 3 years ago

Most of the time, I would like to position my camera such-and-such, then zoom() into the object to fully use the screen. I can only do this by hand now. Is there a way to set the focal_point to the center of the object and zoom in that everything is just in picture?

akaszynski commented 3 years ago

Using set_focus you can set the focus on the center of a mesh, but as for filling the screen, that's not something we've created a formal API for.

Your best bet would be to set_focus prior to showing the plot. The camera will be setup in such a manner as to see the majority of the scene.

nschloe commented 3 years ago

Your best bet would be to set_focus prior to showing the plot. The camera will be setup in such a manner as to see the majority of the scene.

This doesn't work too well. In my examples, it zooms in way too near by default. Besides, I'd still have set the camera position which undoes the zoom anyway.