pyvista.DataSet.rotate_x

pyvista.DataSet.rotate_x#

DataSet.rotate_x(
angle: float,
point: VectorLike[float] | None = None,
transform_all_input_vectors: bool = False,
inplace: bool = False,
)[source]#

Rotate mesh about the x-axis.

Note

See also the notes at transform() which is used by this filter under the hood.

Parameters:
anglefloat

Angle in degrees to rotate about the x-axis.

pointVectorLike[float], optional

Point to rotate about. Defaults to origin.

transform_all_input_vectorsbool, default: False

When True, all input vectors are transformed. Otherwise, only the points, normals and active vectors are transformed.

inplacebool, default: False

Updates mesh in-place.

Returns:
pyvista.DataSet

Rotated dataset.

See also

pyvista.Transform.rotate_x

Concatenate a rotation about the x-axis with a transformation.

Examples

Rotate a mesh 30 degrees about the x-axis.

>>> import pyvista as pv
>>> mesh = pv.Cube()
>>> rot = mesh.rotate_x(30, inplace=False)

Plot the rotated mesh.

>>> pl = pv.Plotter()
>>> _ = pl.add_mesh(rot)
>>> _ = pl.add_mesh(mesh, style='wireframe', line_width=3)
>>> _ = pl.add_axes_at_origin()
>>> pl.show()
../../../_images/pyvista-DataSet-rotate_x-1_00_00.png