pyvista.CylinderSource#
- class CylinderSource(
- center=(0.0, 0.0, 0.0),
- direction=(1.0, 0.0, 0.0),
- radius=0.5,
- height=1.0,
- capping=True,
- resolution=100,
Cylinder source algorithm class.
Warning
pyvista.Cylinder()
function rotates thepyvista.CylinderSource
‘spyvista.PolyData
in its own way. It rotates thepyvista.CylinderSource.output
90 degrees in z-axis, translates and orients the mesh to a newcenter
anddirection
.- Parameters:
- centersequence[
float
], default: (0.0, 0.0, 0.0) Location of the centroid in
[x, y, z]
.- directionsequence[
float
], 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.
- cappingbool, default:
True
Cap cylinder ends with polygons.
- resolution
int
, default: 100 Number of points on the circular face of the cylinder.
- centersequence[
Examples
Create a default CylinderSource.
>>> import pyvista as pv >>> source = pv.CylinderSource() >>> source.output.plot(show_edges=True, line_width=5)
Display a 3D plot of a default
CylinderSource
.>>> import pyvista as pv >>> pl = pv.Plotter() >>> _ = pl.add_mesh(pv.CylinderSource(), show_edges=True, line_width=5) >>> pl.show()
Visualize the output of
CylinderSource
in a 3D plot.>>> pl = pv.Plotter() >>> _ = pl.add_mesh( ... pv.CylinderSource().output, show_edges=True, line_width=5 ... ) >>> pl.show()
The above examples are similar in terms of their behavior.
Methods
Attributes
Get cap cylinder ends with polygons.
Get whether the capping should make the cylinder a capsule.
Get location of the centroid in
[x, y, z]
.Get the direction vector in
[x, y, z]
.Get the height of the cylinder.
Get the output data object for a port on this algorithm.
Get radius of the cylinder.
Get number of points on the circular face of the cylinder.