Extrude Rotation

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 z-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.

import pyvista

# create a line and rotate it about the Z-axis
resolution = 10
line = pyvista.Line(pointa=(0, 0, 0), pointb=(1, 0, 0), resolution=2)
poly = line.extrude_rotate(resolution=resolution)
poly
HeaderData Arrays
PolyDataInformation
N Cells2
N Points33
X Bounds-1.000e+00, 1.000e+00
Y Bounds-9.511e-01, 9.511e-01
Z Bounds0.000e+00, 0.000e+00
N Arrays2
NameFieldTypeN CompMinMax
Texture CoordinatesPointsfloat3220.000e+001.000e+00
DistancePointsfloat6410.000e+001.000e+00


Plot the extruded line

plotter = pyvista.Plotter(shape=(2, 1))
plotter.subplot(0, 0)
plotter.add_text("Line", font_size=24)
plotter.add_mesh(line, color="tan", show_edges=True)
plotter.add_mesh(
    pyvista.PolyData(line.points),
    color="red",
    point_size=10,
    render_points_as_spheres=True,
)
plotter.subplot(1, 0)
plotter.add_text("Extrude Rotated Line", font_size=24)
plotter.add_mesh(poly, color="tan", show_edges=True)
plotter.add_mesh(
    pyvista.PolyData(poly.points),
    color="red",
    point_size=10,
    render_points_as_spheres=True,
)

plotter.show(cpos="xy")
extrude rotate

Out:

[(0.0, 0.0, 5.332062506502935),
 (0.0, 0.0, 0.0),
 (0.0, 1.0, 0.0)]

Total running time of the script: ( 0 minutes 0.617 seconds)

Gallery generated by Sphinx-Gallery