Skip to content

Point Clouds

The Panopti Points object represents a point cloud. To add a point cloud to your scene:

import panopti
import numpy as np

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

points = np.random.randn(128, 3)

viewer.add_points(
    points=points,
    name="MyPointCloud",
    colors=(0.5, 0.5, 0.5),
    size=0.01
)

BaseViewer.add_points
add_points

Adds a Point Cloud object to the viewer.

Parameters:

Name Type Description Default
points ndarray

(N, 3) array of point coordinates.

required
name str

Name for the points object.

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

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

(0.5, 0.5, 0.5)
size float

Size of the points.

0.01
visible bool

Whether the points are visible.

True
opacity float

Opacity of the points.

1.0

Returns:

Name Type Description
Points Points

The created panopti points object.

Points.update(**kwargs)
update

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

Example:

points = viewer.get('MyPoints')
points.update(size=0.02, points=new_points)

Points.delete()
delete

Deletes this point cloud from the viewer.

Points.trans_mat property
trans_mat

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

Points.viewer_points property
viewer_points

Returns the point cloud points under the transformation given by trans_mat.