pyvista.Plotter.enable_shadows#

Plotter.enable_shadows()[source]#

Enable shadows.

Examples

First, plot without shadows enabled (default)

>>> import pyvista as pv
>>> mesh = pv.Sphere()
>>> pl = pv.Plotter(lighting='none', window_size=(1000, 1000))
>>> light = pv.Light()
>>> light.set_direction_angle(20, -20)
>>> pl.add_light(light)
>>> _ = pl.add_mesh(mesh, color='white', smooth_shading=True)
>>> _ = pl.add_mesh(pv.Box((-1.2, -1, -1, 1, -1, 1)))
>>> pl.show()
https://d33wubrfki0l68.cloudfront.net/6709a9a284a704409acd0744fe693d54abe9a72f/7520f/_images/pyvista-plotter-enable_shadows-1_00_00.png

Now, enable shadows.

>>> import pyvista as pv
>>> mesh = pv.Sphere()
>>> pl = pv.Plotter(lighting='none', window_size=(1000, 1000))
>>> light = pv.Light()
>>> light.set_direction_angle(20, -20)
>>> pl.add_light(light)
>>> _ = pl.add_mesh(mesh, color='white', smooth_shading=True)
>>> _ = pl.add_mesh(pv.Box((-1.2, -1, -1, 1, -1, 1)))
>>> pl.enable_shadows()
>>> pl.show()
https://d33wubrfki0l68.cloudfront.net/f666c957666b54c206a3fc1ba67ba3bbc0f41508/3aacb/_images/pyvista-plotter-enable_shadows-1_01_00.png