Regular API function
simIntersectPointsWithPointCloud / sim.intersectPointsWithPointCloud
Description

Removes points from a point cloud, that do not intersect with the provided points (i.e. the result in the point cloud will be the intersection between the two sets of points). When a point cloud doesn't use an OC tree calculation structure, then this operation cannot be performed. See also sim.insertPointsIntoPointCloud, sim.setPointCloudOptions and the other point cloud related functions. 
C/C++ synopsis

int simIntersectPointsWithPointCloud(int pointCloudHandle,int options,const double* pts,int ptCnt,double tolerance,void* reserved) 
C/C++ parameters 
pointCloudHandle: the handle of the point cloud. See also sim.getObject
options: bitcoded:
bit0 set (1): specified points are relative to the point cloud reference frame, otherwise they are relative to the world reference frame
pts: a pointer to the point positions specified as X/Y/Z coordinates.
ptCnt: the number of point coordinates contained in pts
tolerance: a distance used as a tolerance value
reserved: reserved for future extensions. Set to nullptr

C/C++ return value

1 if operation was not successful, otherwise the total number of points in the point cloud

Lua synopsis

int totalPointCnt=sim.intersectPointsWithPointCloud(int pointCloudHandle,int options,float[] points,float tolerance) 
Lua parameters 
Similar to the Cfunction counterpart

Lua return values

Similar to the Cfunction counterpart

Python synopsis 
int totalPointCnt=sim.intersectPointsWithPointCloud(int pointCloudHandle,int options,list points,float tolerance) 
