pyvista_wasm.Arrow

Contents

pyvista_wasm.Arrow#

pyvista_wasm.Arrow(start: tuple[float, float, float] = (0.0, 0.0, 0.0), direction: tuple[float, float, float] = (1.0, 0.0, 0.0), tip_length: float = 0.25, tip_radius: float = 0.1, tip_resolution: int = 20, shaft_radius: float = 0.05, shaft_resolution: int = 20, scale: float | None = None) PolyData#

Create an arrow mesh.

Returns a PolyData representing an arrow starting at start and pointing in direction, backed by VTK.wasm vtkArrowSource.

Parameters:
  • start (tuple, optional) – Starting point of the arrow (x, y, z). Default is (0, 0, 0).

  • direction (tuple, optional) – Direction vector of the arrow. Default is (1, 0, 0).

  • tip_length (float, optional) – Length of the conical tip as a fraction of the total arrow length. Default is 0.25.

  • tip_radius (float, optional) – Radius of the base of the tip. Default is 0.1.

  • tip_resolution (int, optional) – Number of faces around the tip cone. Default is 20.

  • shaft_radius (float, optional) – Radius of the cylindrical shaft. Default is 0.05.

  • shaft_resolution (int, optional) – Number of faces around the shaft cylinder. Default is 20.

  • scale (float, optional) – Scaling factor applied to the entire arrow. When None the arrow is not scaled.

Returns:

An arrow mesh.

Return type:

PolyData

Examples

>>> import pyvista_wasm as pv
>>> arrow = pv.Arrow()
>>> isinstance(arrow, pv.PolyData)
True

Create an arrow with a custom start point and direction:

>>> arrow = pv.Arrow(start=(1, 0, 0), direction=(0, 1, 0))
>>> isinstance(arrow, pv.PolyData)
True

Plot the arrow:

>>> arrow.plot()