grid_from_sph_coords

grid_from_sph_coords#

grid_from_sph_coords(theta, phi, r)[source]#

Create a structured grid from arrays of spherical coordinates.

Parameters:
thetaarray_like[float]

Azimuthal angle in degrees [0, 360].

phiarray_like[float]

Polar (zenith) angle in degrees [0, 180].

rarray_like[float]

Distance (radius) from the point of origin.

Returns:
pyvista.StructuredGrid

Structured grid.

Notes#

The returned grid has no point normals. Warping it with warp_by_scalar() therefore moves every point along a single fixed direction rather than radially outward – see that filter’s notes. For a radial warp, use warp_by_vector() with the (normalized) point coordinates as the vector array instead.