CylinderStructured

CylinderStructured(radius=0.5, height=1.0, center=(0.0, 0.0, 0.0), direction=(1.0, 0.0, 0.0), theta_resolution=32, z_resolution=10)

Create a cylinder mesh as a pyvista.StructuredGrid.

The end caps are left open. This can create a surface mesh if a single value for the radius is given or a 3D mesh if multiple radii are given as a list/array in the radius argument.

Parameters
radiusfloat, sequence, optional

Radius of the cylinder. If a sequence, then describes the radial coordinates of the cells as a range of values as specified by the radius.

heightfloat, optional

Height of the cylinder along its Z-axis.

centersequence

Location of the centroid in [x, y, z].

directionsequence

Direction cylinder Z-axis in [x, y, z].

theta_resolutionint, optional

Number of points on the circular face of the cylinder. Ignored if radius is an iterable.

z_resolutionint, optional

Number of points along the height (Z-axis) of the cylinder.

Returns
pyvista.StructuredGrid

Structured cylinder.

Examples

Default structured cylinder

>>> import pyvista
>>> mesh = pyvista.CylinderStructured()
>>> mesh.plot(show_edges=True)
../../../_images/pyvista-CylinderStructured-1_00_00.png

Structured cylinder with an inner radius of 1, outer of 2, with 5 segments.

>>> import numpy as np
>>> mesh = pyvista.CylinderStructured(radius=np.linspace(1, 2, 5))
>>> mesh.plot(show_edges=True)
../../../_images/pyvista-CylinderStructured-1_01_00.png