pyvista.Property.interpolation

pyvista.Property.interpolation#

property Property.interpolation: InterpolationType[source]#

Return or set the method of shading.

Defaults to pyvista.plotting.themes._LightingConfig.interpolation.

One of the following options.

  • 'Physically based rendering' - Physically based rendering.

  • 'pbr' - Alias for Physically based rendering.

  • 'Phong' - Phong shading.

  • 'Gouraud' - Gouraud shading.

  • 'Flat' - Flat Shading.

This parameter is case insensitive.

Examples

Get the default interpolation and visualize it.

>>> import pyvista as pv
>>> prop = pv.Property()
>>> prop.interpolation
<InterpolationType.FLAT: 0>
>>> prop.plot()
../../../_images/pyvista-Property-interpolation-1_00_00.png

Visualize gouraud shading.

>>> prop.interpolation = 'gouraud'
>>> prop.plot()
../../../_images/pyvista-Property-interpolation-1_01_00.png

Visualize phong shading.

>>> prop.interpolation = 'phong'
>>> prop.plot()
../../../_images/pyvista-Property-interpolation-1_02_00.png

Visualize physically based rendering.

>>> prop.interpolation = 'pbr'
>>> prop.plot()
../../../_images/pyvista-Property-interpolation-1_03_00.png