SphereSource

SphereSource#

class SphereSource(*args, **kwargs)[source]#

Sphere source algorithm class.

Added in version 0.44.0.

Parameters:
radiusfloat, default: 0.5

Sphere radius.

centersequence[float], default: (0.0, 0.0, 0.0)

Center coordinate vector in [x, y, z].

theta_resolutionint, default: 30

Set the number of points in the azimuthal direction (ranging from start_theta to end_theta).

phi_resolutionint, default: 30

Set the number of points in the polar direction (ranging from start_phi to end_phi).

start_thetafloat, default: 0.0

Starting azimuthal angle in degrees [0, 360].

end_thetafloat, default: 360.0

Ending azimuthal angle in degrees [0, 360].

start_phifloat, default: 0.0

Starting polar angle in degrees [0, 180].

end_phifloat, default: 180.0

Ending polar angle in degrees [0, 180].

tessellation‘triangle’ | ‘phi_theta’, default: ‘triangle’

Configure the tessellation of the sphere.

  • 'triangle': tessellate with all TRIANGLE cells.

  • 'phi_theta': tessellate with QUAD cells aligned to the phi and theta directions. Cells at the poles are TRIANGLE cells.

Added in version 0.49.

texture_coordinatesbool, default: False

If True, include a 'Texture Coordinates' array as the active texture coordinates. Enabling this option will also generate a topological seam at theta=0 by duplicating vertices, and the sphere will not be a closed surface.

This option is only supported for complete spheres.

Added in version 0.49.

See also

pyvista.Icosphere

Sphere created from projection of icosahedron.

pyvista.SolidSphere

Sphere that fills 3D space.

Examples

Create a sphere using default parameters.

>>> import pyvista as pv
>>> sphere = pv.SphereSource()
>>> sphere.output.plot(show_edges=True)
../../../_images/pyvista-SphereSource-7fc9e1e670f9f8b6_00_00.png

Create a quarter sphere by setting end_theta.

>>> sphere = pv.SphereSource(end_theta=90)
>>> out = sphere.output.plot(show_edges=True)
../../../_images/pyvista-SphereSource-7fc9e1e670f9f8b6_01_00.png

Create a hemisphere by setting end_phi.

>>> sphere = pv.SphereSource(end_phi=90)
>>> out = sphere.output.plot(show_edges=True)
../../../_images/pyvista-SphereSource-7fc9e1e670f9f8b6_02_00.png

Methods#

Attributes#

SphereSource.center

Get the center in [x, y, z].

SphereSource.end_phi

Get ending polar angle in degrees [0, 360].

SphereSource.end_theta

Get ending azimuthal angle in degrees [0, 360].

SphereSource.output

Get the output data object for a port on this algorithm.

SphereSource.phi_resolution

Get the number of points in the polar direction.

SphereSource.radius

Get sphere radius.

SphereSource.start_phi

Get starting polar angle in degrees [0, 360].

SphereSource.start_theta

Get starting azimuthal angle in degrees [0, 360].

SphereSource.tessellation

Configure the tessellation of the sphere.

SphereSource.texture_coordinates

Enable or disable the generation of texture coordinates.

SphereSource.theta_resolution

Get the number of points in the azimuthal direction.