Skip to main content

PassThrough

https://pointclouds.org/documentation/classpcl_1_1_pass_through.html

Iterates through the entire input once, automatically filtering non-finite points and the points outside the interval specified by setFilterLimits(), which applies only to the field specified by setFilterFieldName().

Constructor​

new PCL.PassThrough(removed, pointType);

For example:

import * as PCL from 'pcl.js';

await PCL.init();

new PCL.PassThrough(PCL.PointXYZ, true);

Parameters:

NameTypeDefaultDescription
pointTypePointTypePointXYZThe point cloud type.
extractRemovedIndicesbooleanfalseInitializing with true will allow us to extract the removed indices.

Methods​

setFilterFieldName()​

setFilterFieldName(fieldName);

Provide the name of the field to be used for filtering data.

In conjunction with setFilterLimits(), points having values outside this interval for this field will be discarded.

Parameters:

NameTypeDefaultDescription
fieldNamestringPath to the blog content directory on the file system, relative to site dir.

getFilterFieldName()​

getFilterFieldName();

Returns:

TypeDescription
stringPath to the blog content directory on the file system, relative to site dir.

setFilterLimits()​

setFilterLimits(min, max);

Set the numerical limits for the field for filtering data.

In conjunction with setFilterFieldName(), points having values outside this interval for this field will be discarded.

Parameters:

NameTypeDefaultDescription
minnumber0Path to the blog content directory on the file system, relative to site dir.
maxnumber0Path to the blog content directory on the file system, relative to site dir.

getFilterLimits()​

getFilterLimits();

Returns:

NameType
limitsFilterLimits

setNegative​

setNegative(negative);

Set whether the regular conditions for points filtering should apply, or the inverted conditions.

Parameters:

NameTypeDefaultDescription
negativebooleanfalsefalse: normal filter behavior, true: inverted behavior.

getNegative​

getNegative();

setKeepOrganized​

setKeepOrganized(keepOrganized);

Set whether the filtered points should be kept and set to the value given through setUserFilterValue (default: NaN), or removed from the PointCloud, thus potentially breaking its organized structure.

Parameters:

NameTypeDefaultDescription
keepOrganizedbooleanfalsefalse: remove points, true: redefine points, keep structure.

getKeepOrganized​

getKeepOrganized(keepOrganized);

setUserFilterValue​

setUserFilterValue(value);

Provide a value that the filtered points should be set to instead of removing them.

Used in conjunction with setKeepOrganized ().

Parameters:

NameTypeDefaultDescription
valuenumbernullnullThe user given value that the filtered point dimensions should be set to.

setInputCloud​

setInputCloud(cloud);

Parameters:

NameTypeDefaultDescription
cloudPointCloudThe point cloud data message

getInputCloud​

getInputCloud();

Returns:

NameTypeDescription
cloudPointCloudThe point cloud data message

filter​

filter(cloud);

Parameters:

NameTypeDefaultDescription
cloud (optional)PointCloudThe point cloud data message

Returns:

NameTypeDescription
cloudPointCloudThe point cloud data message

Type Definitions​

FilterLimits​

interface FilterLimits {
min: number;
max: number;
}