- PointSet.clip_box(bounds=None, invert=True, factor=0.35, progress_bar=False, merge_points=True, crinkle=False)#
Clip a dataset by a bounding box defined by the bounds.
If no bounds are given, a corner of the dataset bounds will be removed.
Length 6 sequence of floats: (xmin, xmax, ymin, ymax, zmin, zmax). Length 3 sequence of floats: distances from the min coordinate of of the input mesh. Single float value: uniform distance from the min coordinate. Length 12 sequence of length 3 sequence of floats: a plane collection (normal, center, …).
pyvista.PolyData: if a poly mesh is passed that represents a box with 6 faces that all form a standard box, then planes will be extracted from the box to define the clipping region.
Flag on whether to flip/invert the clip.
If bounds are not given this is the factor along each axis to extract the default box.
Display a progress bar to indicate progress.
True(default), coinciding points of independently defined mesh elements will be merged.
Crinkle the clip by extracting the entire cells along the clip. This adds the
"cell_ids"array to the
cell_dataattribute that tracks the original cell IDs of the original dataset.
Clip a corner of a cube. The bounds of a cube are normally
[-0.5, 0.5, -0.5, 0.5, -0.5, 0.5], and this removes 1/8 of the cube’s surface.
>>> import pyvista as pv >>> cube = pv.Cube().triangulate().subdivide(3) >>> clipped_cube = cube.clip_box([0, 1, 0, 1, 0, 1]) >>> clipped_cube.plot()
See Clipping with Planes & Boxes for more examples using this filter.