pyvista_wasm.Sphere

Contents

pyvista_wasm.Sphere#

pyvista_wasm.Sphere(radius: float = 1.0, center: tuple[float, float, float] = (0.0, 0.0, 0.0), theta_resolution: int = 30, phi_resolution: int = 30) PolyData#

Create a sphere mesh.

Parameters:
  • radius (float, optional) – Sphere radius. Default is 1.0.

  • center (tuple, optional) – Center of the sphere (x, y, z). Default is (0, 0, 0).

  • theta_resolution (int, optional) – Number of points in the azimuthal direction. Default is 30.

  • phi_resolution (int, optional) – Number of points in the polar direction. Default is 30.

Returns:

A sphere mesh.

Return type:

PolyData

Examples

>>> import pyvista_wasm as pv
>>> sphere = pv.Sphere(radius=1.0)
>>> sphere.n_points
842