pyvista.Plotter.get_image_depth#

Plotter.get_image_depth(fill_value=nan, reset_camera_clipping_range=True)[source]#

Return a depth image representing current render window.

Parameters:
fill_valuefloat, default: numpy.nan

Fill value for points in image that do not include objects in scene. To not use a fill value, pass None.

reset_camera_clipping_rangebool, default: True

Reset the camera clipping range to include data in view.

Returns:
pyvista.pyvista_ndarray

Image of depth values from camera orthogonal to image plane.

Notes

Values in image_depth are negative to adhere to a right-handed coordinate system.

Examples

>>> import pyvista as pv
>>> plotter = pv.Plotter()
>>> actor = plotter.add_mesh(pv.Sphere())
>>> plotter.show()
https://d33wubrfki0l68.cloudfront.net/b50c34e4e259b264afa5cd11b50005383e2728ec/2f2a8/_images/pyvista-plotter-get_image_depth-1_00_00.png
>>> zval = plotter.get_image_depth()