UnstructuredGridFilters.clip(normal='x', origin=None, invert=True, value=0.0, inplace=False, return_clipped=False, progress_bar=False, crinkle=False)#

Clip a dataset by a plane by specifying the origin and normal.

If no parameters are given the clip will occur in the center of that dataset.

normaltuple(float) or str, default: ‘x’

Length 3 tuple for the normal vector direction. Can also be specified as a string conventional direction such as 'x' for (1,0,0) or '-x' for (-1,0,0), etc.

origintuple(float), optional

The center (x,y,z) coordinate of the plane on which the clip occurs. The default is the center of the dataset.

invertbool, optional

Flag on whether to flip/invert the clip.

valuefloat, optional

Set the clipping value along the normal direction. The default value is 0.0.

inplacebool, optional

Updates mesh in-place.

return_clippedbool, optional

Return both unclipped and clipped parts of the dataset.

progress_barbool, optional

Display a progress bar to indicate progress.

crinklebool, optional

Crinkle the clip by extracting the entire cells along the clip. This adds the "cell_ids" array to the cell_data attribute that tracks the original cell IDs of the original dataset.

pyvista.PolyData or tuple(pyvista.PolyData)

Clipped mesh when return_clipped=False, otherwise a tuple containing the unclipped and clipped datasets.


Clip a cube along the +X direction. triangulate is used as the cube is initially composed of quadrilateral faces and subdivide only works on triangles.

>>> import pyvista as pv
>>> cube = pv.Cube().triangulate().subdivide(3)
>>> clipped_cube = cube.clip()
>>> clipped_cube.plot()

Clip a cube in the +Z direction. This leaves half a cube below the XY plane.

>>> import pyvista as pv
>>> cube = pv.Cube().triangulate().subdivide(3)
>>> clipped_cube = cube.clip('z')
>>> clipped_cube.plot()

See Clipping with a Surface for more examples using this filter.