pyvista.Property.roughness#

property Property.roughness: float[source]#

Return or set roughness.

Default pyvista.plotting.themes._LightingConfig.roughness.

This requires that the interpolation be set to 'Physically based rendering'. Must be between 0 and 1.

Examples

Set roughness to 0.1

>>> import pyvista as pv
>>> prop = pv.Property()
>>> # requires physically based rendering
>>> prop.interpolation = 'pbr'
>>> prop.metallic = 0.5  # helps to visualize metallic
>>> prop.roughness = 0.1
>>> prop.roughness
0.1

Visualize default roughness with metallic of 0.5.

>>> prop.roughness = 0.5
>>> prop.plot()
https://d33wubrfki0l68.cloudfront.net/214bca84e7dfbe6b223f2fdbf2d394873d09571c/45e53/_images/pyvista-property-roughness-1_00_00.png

Visualize roughness at 0.0 with metallic of 0.5.

>>> prop.roughness = 0.0
>>> prop.plot()
https://d33wubrfki0l68.cloudfront.net/bc321b4aee801addb8acf21524c9c4cc20340b61/c130a/_images/pyvista-property-roughness-1_01_00.png

Visualize roughness at 1.0 with metallic of 0.5.

>>> prop.roughness = 1.0
>>> prop.plot()
https://d33wubrfki0l68.cloudfront.net/923bf83c859c14513a06dfb3862e9f4b73673594/9e5fd/_images/pyvista-property-roughness-1_02_00.png