Vuer

Arrow

The Arrow component renders directional arrows for visualization. This is ideal for:

  • Visualizing vectors and directions
  • Showing force or velocity fields

Basic Usage

A minimal example that creates an arrow:

python
import asyncio
from vuer import Vuer
from vuer.schemas import DefaultScene, Arrow, OrbitControls

app = Vuer()

@app.spawn(start=True)
async def main(session):
    session.set @ DefaultScene(
        Arrow(
            key="arrow",
            position=[0, 0.25, 0],
            rotation=[0, -1.57, 0],
            scale=1,
        ),
        up=[0, 0, 1],
        bgChildren=[
            OrbitControls(key="OrbitControls")
        ],
    )

    while True:
        await asyncio.sleep(1.0)

Key Parameters

ParameterTypeDefaultDescription
keystr-Unique identifier for the arrow
positionlist[0,0,0]Arrow origin position
rotationlist[0,0,0]Arrow rotation (Euler angles)
matrixlist-4x4 transformation matrix (16 numbers). Overrides position and rotation
scalefloat1.0Overall arrow size
headScalefloat1.0Scale factor for the arrow head
lodint-Level of detail - number of segments for the cone and stem