Skip to content

Arrows

The Panopti Arrows object represents a collection of floating arrows defined by an array of starting points and ending points. To add arrows to your scene:

import panopti
import numpy as np

viewer = panopti.connect(server_url="http://localhost:8080", viewer_id='client')

start_points = np.random.randn(64, 3)
end_points = start_points.clone()
end_points[:, 0] += 3.0

viewer.add_arrows(
    starts=start_points,
    ends=end_points,
    name='MyArrows',
    color=(0.5, 0.5, 0.5),
    width=0.02
)

BaseViewer.add_arrows
add_arrows

Adds an Arrows object to the viewer.

Parameters:

Name Type Description Default
starts ndarray

(N, 3) array of start points for the arrows.

required
ends ndarray

(N, 3) array of end points for the arrows.

required
name str

Name for the arrows object.

required
color Union[Tuple[float, float, float], ndarray]

(N, 3) or (3,) array of RGB colors for the arrows.

(0, 0, 0)
width float

Width of the arrows.

0.01
visible bool

Whether the arrows are visible.

True
opacity float

Opacity of the arrows.

1.0

Returns:

Name Type Description
Arrows Arrows

The created panopti arrows object.

Arrows.update(**kwargs)
update

Updates this arrow's attributes and propagate updates to the viewer.

Example:

arrows = viewer.get('MyArrows')
arrows.update(width=0.03, color=new_color)

Arrows.delete()
delete

Deletes this arrow from the viewer.

Arrows.trans_mat property
trans_mat

Returns the 4x4 transformation matrix corresponding to the object's position, rotation, and scale in the viewer.

Arrows.viewer_starts property
viewer_starts

Returns the Arrow's starts attribute under the transformation given by trans_mat.

Arrows.viewer_ends property
viewer_ends

Returns the Arrow's ends attribute under the transformation given by trans_mat.