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:
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¶
Parameter |
Type |
Default |
Description |
|---|---|---|---|
|
str |
- |
Unique identifier for the line |
|
list/ndarray |
- |
Array of 3D points (Vector3, Vector2, [x,y,z], [x,y], or numbers) |
|
str |
|
Line color (hex or named color) |
|
float |
|
Line thickness in pixels |
|
bool |
|
If true, renders LineSegments2; otherwise renders Line2 |
|
bool |
|
Enable dashed line rendering |
|
list |
- |
Optional array of RGB values for each point |
Learn More¶
For detailed examples of using Line, see:
Spline Frustum - Camera trajectory visualization