PFTrack Documentation Python Node API  

Dense Point Cloud module API

Accessing dense point clouds  |  API functions

Accessing dense point clouds

The number of dense point clouds being passed into the node can be found:

num= pfpy.getNumDenseClouds()
print("node is reading", num, "dense clouds")

A reference to an existing dense point cloud can be obtained as follows:

c= pfpy.getDenseCloudRef(index)

where index is an integer indicating which cloud to read in the range 0 and N-1 inclusive, where N is the number of clouds returned by pfpy.getNumDenseClouds().

By calling the Dense Point Cloud API functions described below, cloud data can be read.

API functions

Examples of these functions in use are provided by the python scripts available in the exports, macros and nodes installation folders.

getName

getNumPoints

getPointPos

getPointNormal

getPointColour



Command:

getName()

Parameters:

none

Description:

Returns the dense point cloud name

Example:

c= pfpy.getDenseCloudRef(0)
print("Dense cloud is named", c.getName())



Command:

getNumPoints()

Parameters:

none

Description:

Returns the number of points in the dense point cloud

Example:

c= pfpy.getDenseCloudRef(0)
print("Point count= ", m.getNumPoints())

Command:

getPointPos(index)

Parameters:

unsigned integer point index number

Description:

Returns the position of the specified point

Example:

c= pfpy.getDenseCloudRef(0)
print("Point 100 position= ", c.getPointPos(100))
print("Point 100 normal= ", c.getPointNormal(100))
print("Point 100 colour= ", c.getPointColour(100))



Command:

getPointNormal(index)

Parameters:

unsigned integer point index number

Description:

Returns the normal of the specified point

Example:

c= pfpy.getDenseCloudRef(0)
print("Point 100 position= ", c.getPointPos(100))
print("Point 100 normal= ", c.getPointNormal(100))
print("Point 100 colour= ", c.getPointColour(100))



Command:

getPointColour(index)

Parameters:

unsigned integer point index number

Description:

Returns the colour of the specified point in the range [0..1]

Example:

c= pfpy.getDenseCloudRef(0)
print("Point 100 position= ", c.getPointPos(100))
print("Point 100 normal= ", c.getPointNormal(100))
print("Point 100 colour= ", c.getPointColour(100))