Rotate Points

This example will demonstrate how to rotate points in a vtkPolyData object around some origin on the XY plane.

THis example demos PVGeo.filters.RotatePoints

from pyvista import examples
from PVGeo.filters import RotatePoints

Get pyvista.PolyData sample input to rotate

mesh = examples.load_uniform().cell_centers()
mesh.plot()
rotate points

Out:

[(19.954813220625095, 19.954813220625095, 19.954813220625095),
 (4.5, 4.5, 4.5),
 (0.0, 0.0, 1.0)]

Use the filter:

rotated = RotatePoints(angle=33.3).apply(mesh)
rotated.plot()
rotate points

Out:

[(13.688858027682276, 21.299487937976537, 22.726884665313836),
 (-4.5380266376315594, 3.072603272662702, 4.5),
 (0.0, 0.0, 1.0)]

Total running time of the script: ( 0 minutes 0.604 seconds)

Gallery generated by Sphinx-Gallery