- PolyDataFilters.extrude_rotate(resolution=30, inplace=False, translation=0.0, dradius=0.0, angle=360.0, capping=None, rotation_axis=(0, 0, 1), progress_bar=False)[source]#
Sweep polygonal data creating “skirt” from free edges and lines, and lines from vertices.
This takes polygonal data as input and generates polygonal data on output. The input dataset is swept around the axis to create new polygonal primitives. These primitives form a “skirt” or swept surface. For example, sweeping a line results in a cylindrical shell, and sweeping a circle creates a torus.
There are a number of control parameters for this filter. You can control whether the sweep of a 2D object (i.e., polygon or triangle strip) is capped with the generating geometry via the
cappingparameter. Also, you can control the angle of rotation, and whether translation along the axis is performed along with the rotation. (Translation is useful for creating “springs”.) You also can adjust the radius of the generating geometry with the
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.
This filter can be used to model axisymmetric objects like cylinders, bottles, and wine glasses; or translational rotational symmetric objects like springs or corkscrews.
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.
Number of pieces to divide line into.
Overwrites the original mesh inplace.
Total amount of translation along the axis.
Change in radius during sweep process.
The angle of rotation in degrees.
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.
The direction vector of the axis around which the rotation is done. It requires vtk>=9.1.0.
Display a progress bar to indicate progress.
Rotationally extruded mesh.
Create a “spring” using the rotational extrusion filter.
>>> import pyvista >>> profile = pyvista.Polygon(center=[1.25, 0.0, 0.0], radius=0.2, ... normal=(0, 1, 0), n_sides=30) >>> extruded = profile.extrude_rotate(resolution=360, translation=4.0, ... dradius=0.5, angle=1500.0, ... capping=True) >>> extruded.plot(smooth_shading=True)
Create a “wine glass” using the rotational extrusion filter.
>>> import numpy as np >>> points = np.array([[-0.18, 0, 0], ... [-0.18, 0, 0.01], ... [-0.18, 0, 0.02], ... [-0.01, 0, 0.03], ... [-0.01, 0, 0.04], ... [-0.02, 0, 0.5], ... [-0.05, 0, 0.75], ... [-0.1, 0, 0.8], ... [-0.2, 0, 1.0]]) >>> spline = pyvista.Spline(points, 30) >>> extruded = spline.extrude_rotate(resolution=20, capping=False) >>> extruded.plot(color='tan')