enable_shadows

Plotter.enable_shadows()

Enable shadows.

Examples

First, plot without shadows enabled (default)

>>> import pyvista
>>> mesh = pyvista.Sphere()
>>> pl = pyvista.Plotter(lighting='none', window_size=(1000, 1000))
>>> light = pyvista.Light()
>>> light.set_direction_angle(20, -20)
>>> pl.add_light(light)
>>> _ = pl.add_mesh(mesh, color='white', smooth_shading=True)
>>> _ = pl.add_mesh(pyvista.Box((-1.2, -1, -1, 1, -1, 1)))
>>> pl.show()
../../../_images/pyvista-Plotter-enable_shadows-1_00_00.png

Now, enable shadows.

>>> import pyvista
>>> mesh = pyvista.Sphere()
>>> pl = pyvista.Plotter(lighting='none', window_size=(1000, 1000))
>>> light = pyvista.Light()
>>> light.set_direction_angle(20, -20)
>>> pl.add_light(light)
>>> _ = pl.add_mesh(mesh, color='white', smooth_shading=True)
>>> _ = pl.add_mesh(pyvista.Box((-1.2, -1, -1, 1, -1, 1)))
>>> pl.enable_shadows()
>>> pl.show()
../../../_images/pyvista-Plotter-enable_shadows-1_01_00.png