DataSetAttributes.active_normals#
- property DataSetAttributes.active_normals: pyvista_ndarray | None[source]#
Return the normals.
- Returns:
pyvista_ndarrayNormals of this dataset attribute.
Noneif no normals have been set.
Notes#
Field data will have no normals.
Examples#
Download Python source code | Download Jupyter notebook
First, compute cell normals.
>>> import pyvista as pv
>>> mesh = pv.Plane(i_resolution=1, j_resolution=1)
>>> mesh.point_data
pyvista DataSetAttributes
Association : POINT
Active Scalars : None
Active Vectors : None
Active Texture : TextureCoordinates
Active Normals : Normals
Contains arrays :
TextureCoordinates float32 (4, 2) TCOORDS
Normals float32 (4, 3) NORMALS
>>> mesh.point_data.active_normals
pyvista_ndarray([[0., 0., 1.],
[0., 0., 1.],
[0., 0., 1.],
[0., 0., 1.]], dtype=float32)
Assign normals to the cell arrays. An array will be added
named "Normals".
>>> mesh.cell_data.active_normals = [[0.0, 0.0, 1.0]]
>>> mesh.cell_data
pyvista DataSetAttributes
Association : CELL
Active Scalars : None
Active Vectors : None
Active Texture : None
Active Normals : Normals
Contains arrays :
Normals float64 (1, 3) NORMALS