Note
Click here to download the full example code
Types of Shading¶
Comparison of default, flat shading vs. smooth shading.
# sphinx_gallery_thumbnail_number = 2
import pyvista
pyvista.set_plot_theme("document")
PyVista supports two types of shading, flat and smooth shading that uses VTKās Phong shading algorithm.
This is a plot with the default flat shading:
sphere = pyvista.Sphere()
sphere.plot(color="w")

Out:
[(1.9264490110725325, 1.9264490110725325, 1.9264490110725325),
(0.0, 0.0, 0.0),
(0.0, 0.0, 1.0)]
Hereās the same sphere with smooth shading:
sphere.plot(color="w", smooth_shading=True)

Out:
[(1.9264490110725325, 1.9264490110725325, 1.9264490110725325),
(0.0, 0.0, 0.0),
(0.0, 0.0, 1.0)]
Total running time of the script: ( 0 minutes 1.167 seconds)