Warning

Nightly releases are generated automatically from the latest source code and are intended for experimental purposes only. These builds may contain incomplete or untested features, bugs, or security vulnerabilities, and as such, are not for production use. Users should be aware that nightly releases may cause unexpected behavior, data loss, or system instability. Use of these releases is at the user's own risk, and it is advised to have adequate backups before testing. The software is provided as is with no guarantees or support.

ViewerPointCloudAPI

Interface ViewerPointCloudAPIExperimental

Experimental. May be changed in the future without notice.

The ViewerPointCloudAPI provides functionality to visualize point clouds based on a given set of points.

This API visualizes a set of CloudPoints in the 3D space. At the moment, this happens without any further optimization. Thus, it may come to limitations in terms of performance and memory consumption when visualizing a large number of points.

Example: Create, change and remove a point cloud.

// get an instance of the ContextAPI and the matching ViewerAPI
const context = webvis.getContext();
const viewer = context.getViewer();

// define a list of cloud points to visualize
const points = [
  { position: [0, 1, 0], color: [1, 0, 0, 1] }, // first point
  { position: [0, 1, 1], color: [1, 0, 0, 1] }, // second point
  { position: [0, 0, 2], color: [1, 0, 0, 1] }, // third point
];

// create a point cloud
const pointCloudId = viewer.createPointCloud(points, { enabled: true });

// change the scale of the point cloud
viewer.changePointCloud(pointCloudId, { scale: 2.0 });

// remove the point cloud
viewer.removePointCloud(pointCloudId);

The following events are associated with the ViewerPointCloudAPI:

interface ViewerPointCloudAPI {
    changePointCloud(
        pointCloudId: number,
        properties: PointCloudProperties,
    ): void;
    createPointCloud(
        points: CloudPoint[],
        properties?: PointCloudProperties,
    ): number;
    getPointCloudData(pointCloudId: number): PointCloudProperties;
    getPointClouds(): number[];
    removePointCloud(pointCloudId: number): void;
}

Hierarchy (View Summary)

Methods

  • Experimental

    Experimental. May be changed in the future without notice.

    Changes one or more properties of the point cloud with the specified ID and triggers a ViewerPointCloudChangedEvent.

    Parameters

    Returns void

  • Experimental

    Experimental. May be changed in the future without notice.

    Returns the properties of a point cloud dataset.

    Parameters

    • pointCloudId: number

      The ID of point cloud to query. Obtained using createPointCloud.

    Returns PointCloudProperties

    Properties of the point cloud.

  • Experimental

    Experimental. May be changed in the future without notice.

    Returns a list of all point clouds.

    Returns number[]

    Array of point cloud IDs.

  • Experimental

    Experimental. May be changed in the future without notice.

    Removes the point cloud with the specified ID and triggers a ViewerPointCloudRemovedEvent.

    Parameters

    • pointCloudId: number

      The ID of point cloud to remove. Obtained using createPointCloud.

    Returns void