File indexing completed on 2026-04-09 07:49:07
0001
0002 """
0003
0004 https://docs.pyvista.org/examples/01-filter/glyphs.html
0005
0006 """
0007
0008 import pyvista as pv
0009 from pyvista import examples
0010
0011 mesh = examples.download_carotid().threshold(145, scalars="scalars")
0012 mask = mesh['scalars'] < 210
0013 mesh['scalars'][mask] = 0
0014
0015
0016 geom = pv.Arrow()
0017
0018
0019 glyphs = mesh.glyph(orient="vectors", scale="scalars", factor=0.003, geom=geom)
0020
0021
0022 pl = pv.Plotter()
0023 pl.add_mesh(glyphs, show_scalar_bar=False, lighting=False, cmap='coolwarm')
0024 pl.camera_position = [(146.53, 91.28, 21.70),
0025 (125.00, 94.45, 19.81),
0026 (-0.086, 0.007, 0.996)]
0027 cpos = pl.show()
0028