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)[source]#
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 theradius
argument.- Parameters
- radius
float
, 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
.- height
float
,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_resolution
int
,optional
Number of points on the circular face of the cylinder. Ignored if
radius
is an iterable.- z_resolution
int
,optional
Number of points along the height (Z-axis) of the cylinder.
- radius
- Returns
pyvista.StructuredGrid
Structured cylinder.
Examples
Default structured cylinder
>>> import pyvista >>> mesh = pyvista.CylinderStructured() >>> mesh.plot(show_edges=True)
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)