grid_from_sph_coords

grid_from_sph_coords#

grid_from_sph_coords(
theta: VectorLikeFloat,
phi: VectorLikeFloat,
r: VectorLikeFloat,
) → StructuredGrid[source]#

Create a structured grid from arrays of spherical coordinates.

Parameters:
thetaVectorLikeFloat

Azimuthal angle in degrees [0, 360].

phiVectorLikeFloat

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

rVectorLikeFloat

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.