PolyDataFilters.extrude_trim#
- PolyDataFilters.extrude_trim(
- direction,
- trim_surface,
- extrusion='boundary_edges',
- capping='intersection',
- inplace: bool = False,
- progress_bar: bool = False,
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 (that is, 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.
- Parameters:
- direction
numpy.ndarrayor sequence Direction vector to extrude.
- trim_surface
pyvista.PolyData Surface which trims the surface.
- extrusion
str, default: “boundary_edges” Control the strategy of extrusion. One of the following:
"boundary_edges""all_edges"
The default only generates faces on the boundary of the original input surface. When using
"all_edges", faces are created along interior points as well.- capping
str, default: “intersection” Control the strategy of capping. One of the following:
"intersection""minimum_distance""maximum_distance""average_distance"
- inplacebool, default:
False Overwrites the original mesh in-place.
- progress_barbool, default:
False Display a progress bar to indicate progress.
- direction
- Returns:
pyvista.PolyDataExtruded mesh trimmed by a surface.
Examples#
Download Python source code | Download Jupyter notebook
Extrude a disc.
>>> import pyvista as pv
>>> import numpy as np
>>> plane = pv.Plane(i_size=2, j_size=2, direction=[0, 0.8, 1])
>>> disc = pv.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)
Used In#
Gallery Examples