跳到主要内容

PointCloudViewer

Simple point cloud visualization class.

Install Dependencies:

npm install three
警告

The version of Three.js needs to be greater than 0.123.0

For Example:

import PointCloudViewer from 'pcl.js/PointCloudViewer'

const pointCloudViewer = new PointCloudViewer(document.getElementById('canvas'), 500, 500);
pointCloudViewer.addPointCloud(cloud)

PointCloudViewer

Constructor

new PointCloudViewer(canvasEl, width, height);

Parameters:

NameTypeDefaultDescription
canvasElDOMA canvas where the renderer draws its output.
widthnumber200The canvas width
heightnumber200The canvas height

Methods

addPointCloud()

addPointCloud(cloud, id);

Parameters:

NameTypeDefaultDescription
cloudPointCloudThe point cloud data .
idstring'point-cloud'The point cloud id

addPointCloudByUrl()

addPointCloudByUrl(url, id, onProgress)

removePointCloud()

removePointCloud(id);

setPointCloudProperties()

setPointCloudProperties(properties);

setBackgroundColor()

setBackgroundColor(color);

setCameraParameters()

setCameraParameters(parameters);

setOrbitControls()

setOrbitControls(properties);

setAxesHelper()

setAxesHelper(properties);

setGridHelper()

setGridHelper(properties);

setSize()

setSize(width, height);

show()

show();

hidden()

hidden();

destroy()

destroy();