Vuer

Line

The Line component renders lines and splines from a set of 3D points. This is ideal for:

  • Visualizing camera trajectories and paths
  • Drawing splines and curves
  • Creating wireframe visualizations
  • Displaying motion trails

Basic Usage

A minimal example that creates a line from points:

python
import asyncio
import numpy as np
from vuer import Vuer
from vuer.schemas import DefaultScene, Line, OrbitControls

app = Vuer()

# Create a spiral path
t = np.linspace(0, 4 * np.pi, 100)
points = np.column_stack([
    np.cos(t),
    np.sin(t),
    t / (4 * np.pi)
])

@app.spawn(start=True)
async def main(session):
    session.set @ DefaultScene(
        Line(
            key="spiral",
            points=points,
            color="red",
            lineWidth=3,
        ),
        bgChildren=[
            OrbitControls(key="OrbitControls")
        ],
    )

    while True:
        await asyncio.sleep(1.0)

Key Parameters

ParameterTypeDefaultDescription
keystr-Unique identifier for the line
pointslist/ndarray-Array of 3D points (Vector3, Vector2, [x,y,z], [x,y], or numbers)
colorstr"black"Line color (hex or named color)
lineWidthfloat1Line thickness in pixels
segmentsboolFalseIf true, renders LineSegments2; otherwise renders Line2
dashedboolFalseEnable dashed line rendering
vertexColorslist-Optional array of RGB values for each point

Learn More

For detailed examples of using Line, see: