Skip to content

ListOfPoints3D

Represents an ordered collection of Points3D instances. This datatype is used when multiple point clouds are consumed or produced (e.g. before/after filtering, multi-view) within the Telekinesis ecosystem.

Field

Required

FieldTypeDescription
point3d_listlist[Points3D]List of Points3D instances; each element is a point cloud.

Optional

None.

Methods

MethodDescription
to_list()Returns a Python list whose items are Points3D instances (the same as the point3d_list field).

Example

From the datatypes examples:

python
import numpy as np
from datatypes import datatypes
from loguru import logger

# ------------------------------------------------
# 1. Create ListOfPoints3D instance
# ------------------------------------------------
point_1 = datatypes.Points3D(
    positions=np.array([[0.0, 0.0, 0.0], [1.0, 0.0, 0.0]], dtype=np.float32),
    colors=np.array([[255, 0, 0, 255], [0, 255, 0, 255]], dtype=np.uint8),
)
point_2 = datatypes.Points3D(
    positions=np.array([[0.0, 1.0, 0.0], [1.0, 1.0, 0.0]], dtype=np.float32),
    colors=np.array([[0, 0, 255, 255], [255, 255, 0, 255]], dtype=np.uint8),
)
list_of_points_3d = datatypes.ListOfPoints3D(point3d_list=[point_1, point_2])

# ------------------------------------------------
# 2. Access point clouds via to_list
# ------------------------------------------------
points_list = list_of_points_3d.to_list()
logger.info("ListOfPoints3D to_list num_items={}", len(points_list))
logger.info("ListOfPoints3D to_list first positions shape={}", points_list[0].to_numpy("positions").shape)
logger.info("ListOfPoints3D to_list second positions shape={}", points_list[1].to_numpy("positions").shape)