PolyDataFilters.strip

PolyDataFilters.strip#

PolyDataFilters.strip(
*,
join: bool = False,
max_length: int = 1000,
pass_cell_data: bool = False,
pass_cell_ids: bool = False,
pass_point_ids: bool = False,
progress_bar: bool = False,
) → PolyData[source]#

Strip poly data cells.

Generates triangle strips and/or polylines from input polygons, triangle strips, and lines.

Polygons are assembled into triangle strips only if they are triangles; other types of polygons are passed through to the output and not stripped. (Use triangulate filter to triangulate non-triangular polygons prior to running this filter if you need to strip all the data.) The filter will pass through (to the output) vertices if they are present in the input polydata.

Also note that if triangle strips or polylines are defined in the input they are passed through and not joined nor extended, except that join joins polylines too. (If you wish to strip these use triangulate filter to fragment the input into triangles and lines prior to running this filter.)

This filter implements vtkStripper.

Changed in version 0.50: pass_cell_data and pass_cell_ids give one tuple per line segment and keep the input’s field data, and join keeps to the input’s edges.

Parameters:
joinbool, default: False

If True, the output polygonal segments will be joined if they are contiguous. This is useful after slicing a surface.

max_lengthint, default: 1000

Specify the maximum number of triangles in a triangle strip, and/or the maximum number of lines in a polyline.

pass_cell_databool, default: False

Pass the cell data of the input to the output as field data, with one tuple per piece of the output in cell order: each vertex and polygon cell, each line segment and each triangle of a strip. A line with fewer than two points holds no segment, so it adds no tuple.

pass_cell_idsbool, default: False

If True, the output has a field data array 'vtkOriginalCellIds' holding the id of the input cell that produced each piece of the output, in the same order as pass_cell_data.

pass_point_idsbool, default: False

If True, the output polygonal dataset will have a point data array that holds the point index of the original vertex that produced each output vertex. This is useful for picking. The default is False to conserve memory.

progress_barbool, default: False

Display a progress bar to indicate progress.

Returns:
pyvista.PolyData

Stripped mesh.

Examples#

Download Python source code | Download Jupyter notebook

>>> from pyvista import examples
>>> mesh = examples.load_airplane()
>>> slc = mesh.slice(normal='z', origin=(0, 0, -10))
>>> stripped = slc.strip()
>>> stripped.n_cells
1
>>> stripped.plot(show_edges=True, line_width=3)
../../../_images/pyvista-PolyDataFilters-strip-166117317d00367a_00_00.png