- PolyData.extrude(vector, capping=None, inplace=False, progress_bar=False)#
Sweep polygonal data creating a “skirt” from free edges.
This will create a line from vertices.
This takes polygonal data as input and generates polygonal data on output. The input dataset is swept according to some extrusion function and creates new polygonal primitives. These primitives form a “skirt” or swept surface. For example, sweeping a line results in a quadrilateral, and sweeping a triangle creates a “wedge”.
The skirt is generated by locating certain topological features. Free edges (edges of polygons or triangle strips only used by one polygon or triangle strips) generate surfaces. This is true also of lines or polylines. Vertices generate lines.
Changed in version 0.32.0: The
cappingkeyword was added with a default of
False. The previously used VTK default corresponds to
capping=True. In a future version the default will be changed to
Trueto match the behavior of the underlying VTK filter.
Direction and length to extrude the mesh in.
Control if the sweep of a 2D object is capped. The default is
False, which differs from VTK’s default.
cappingkeyword was added in version 0.32.0 with a default value of
False. In a future version this default will be changed to
Trueto match the behavior of the underlying VTK filter. It is recommended to explicitly pass a value for this keyword argument to prevent future changes in behavior and warnings.
Overwrites the original mesh in-place.
Display a progress bar to indicate progress.
Extrude a half circle arc.
>>> import pyvista >>> arc = pyvista.CircularArc([-1, 0, 0], [1, 0, 0], [0, 0, 0]) >>> mesh = arc.extrude([0, 0, 1], capping=False) >>> mesh.plot(color='tan')
Extrude and cap an 8 sided polygon.
>>> poly = pyvista.Polygon(n_sides=8) >>> mesh = poly.extrude((0, 0, 1.5), capping=True) >>> mesh.plot(line_width=5, show_edges=True)