pyvista_wasm.Disc

Contents

pyvista_wasm.Disc#

pyvista_wasm.Disc(center: tuple[float, float, float] = (0.0, 0.0, 0.0), inner: float = 0.25, outer: float = 0.5, normal: tuple[float, float, float] = (0.0, 0.0, 1.0), r_res: int = 1, c_res: int = 6) PolyData#

Create a disc (annular ring) geometric primitive.

This mirrors the pyvista.Disc() API. The geometry is built directly from (r_res + 1) rings of c_res points each, connected as triangles, so it renders correctly in VTK.wasm without depending on any specific VTK.wasm source filter.

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

  • inner (float, optional) – Inner radius of the disc. Default is 0.25.

  • outer (float, optional) – Outer radius of the disc. Default is 0.5.

  • normal (tuple, optional) – Normal vector of the disc. Default is (0, 0, 1).

  • r_res (int, optional) – Number of radial subdivisions. Default is 1.

  • c_res (int, optional) – Number of circumferential subdivisions. Default is 6.

Returns:

A disc (annular ring) mesh.

Return type:

PolyData

Examples

>>> import pyvista_wasm as pv
>>> disc = pv.Disc(center=(0, 0, 0), inner=0.25, outer=0.5)
>>> disc.n_points
12
>>> disc.plot()