PolyDataFilters.extrude_trim(direction, trim_surface, extrusion='boundary_edges', capping='intersection', inplace=False, progress_bar=False)[source]#

Extrude polygonal data trimmed by a surface.

The input dataset is swept along a specified direction forming a “skirt” from the boundary edges 2D primitives (i.e., edges used by only one polygon); and/or from vertices and lines. The extent of the sweeping is defined where the sweep intersects a user-specified surface.

directionnumpy.ndarray or sequence

Direction vector to extrude.


Surface which trims the surface.

extrusionstr or int, optional

Control the strategy of extrusion. One of the following:

  • "boundary_edges"

  • "all_edges"

The default is "boundary_edges", which only generates faces on the boundary of the original input surface. When using "all_edges", faces are created along interior points as well.

cappingstr or int, optional

Control the strategy of capping. One of the following:

  • "intersection"

  • "minimum_distance"

  • "maximum_distance"

  • "average_distance"

The default is “intersection”.

inplacebool, optional

Overwrites the original mesh in-place.

progress_barbool, optional

Display a progress bar to indicate progress.


Extruded mesh trimmed by a surface.


Extrude a disc.

>>> import pyvista
>>> import numpy as np
>>> plane = pyvista.Plane(i_size=2, j_size=2, direction=[0, 0.8, 1])
>>> disc = pyvista.Disc(center=(0, 0, -1), c_res=50)
>>> direction = [0, 0, 1]
>>> extruded_disc = disc.extrude_trim(direction, plane)
>>> extruded_disc.plot(smooth_shading=True, split_sharp_edges=True)