pyvista.SphereSource#
- class SphereSource(*args, **kwargs)[source]#
Sphere source algorithm class.
Added in version 0.44.0.
- Parameters:
- radius
float, default: 0.5 Sphere radius.
- centersequence[
float], default: (0.0, 0.0, 0.0) Center coordinate vector in
[x, y, z].- theta_resolution
int, default: 30 Set the number of points in the azimuthal direction (ranging from
start_thetatoend_theta).- phi_resolution
int, default: 30 Set the number of points in the polar direction (ranging from
start_phitoend_phi).- start_theta
float, default: 0.0 Starting azimuthal angle in degrees
[0, 360].- end_theta
float, default: 360.0 Ending azimuthal angle in degrees
[0, 360].- start_phi
float, default: 0.0 Starting polar angle in degrees
[0, 180].- end_phi
float, default: 180.0 Ending polar angle in degrees
[0, 180].
- radius
See also
pyvista.IcosphereSphere created from projection of icosahedron.
pyvista.SolidSphereSphere that fills 3D space.
Examples
Create a sphere using default parameters.
>>> import pyvista as pv >>> sphere = pv.SphereSource() >>> sphere.output.plot(show_edges=True)
Create a quarter sphere by setting
end_theta.>>> sphere = pv.SphereSource(end_theta=90) >>> out = sphere.output.plot(show_edges=True)
Create a hemisphere by setting
end_phi.>>> sphere = pv.SphereSource(end_phi=90) >>> out = sphere.output.plot(show_edges=True)
Methods
Attributes
Get the center in
[x, y, z].Get ending polar angle in degrees
[0, 360].Get ending azimuthal angle in degrees
[0, 360].Get the output data object for a port on this algorithm.
Get the number of points in the polar direction.
Get sphere radius.
Get starting polar angle in degrees
[0, 360].Get starting azimuthal angle in degrees
[0, 360].Get the number of points in the azimuthal direction.