get_image_depth

Plotter.get_image_depth(fill_value=nan, reset_camera_clipping_range=True)

Return a depth image representing current render window.

Parameters
fill_valuefloat, optional

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, optional

Reset the camera clipping range to include data in view.

Returns
numpy.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
>>> plotter = pyvista.Plotter()
>>> actor = plotter.add_mesh(pyvista.Sphere())
>>> plotter.store_image = True
>>> plotter.show()
../../../_images/pyvista-Plotter-get_image_depth-1_00_00.png
>>> zval = plotter.get_image_depth()