Cylinder#
- Cylinder(center=(0.0, 0.0, 0.0), direction=(1.0, 0.0, 0.0), radius=0.5, height=1.0, resolution=100, capping=True)[source]#
Create the surface of a cylinder.
See also
pyvista.CylinderStructured()
.- Parameters:
- centersequence, default: (0.0, 0.0, 0.0)
Location of the centroid in
[x, y, z]
.- directionsequence, default: (1.0, 0.0, 0.0)
Direction cylinder points to in
[x, y, z]
.- radius
float
, default: 0.5 Radius of the cylinder.
- height
float
, default: 1.0 Height of the cylinder.
- resolution
int
, default: 100 Number of points on the circular face of the cylinder.
- cappingbool, default:
True
Cap cylinder ends with polygons.
- Returns:
pyvista.PolyData
Cylinder surface.
Examples
>>> import pyvista >>> import numpy as np >>> cylinder = pyvista.Cylinder(center=[1, 2, 3], direction=[1, 1, 1], ... radius=1, height=2) >>> cylinder.plot(show_edges=True, line_width=5, cpos='xy')