MIL_ID SrcContainerOrImageBufId,  //in 
MIL_ID RefMilObjectId,  //in 
MIL_ID DstImageBufId,  //in 
MIL_INT64 DistanceType,  //in 
MIL_DOUBLE Param,  //in 
MIL_INT64 ControlFlag  //in 
This function calculates various distance measurements between a point cloud or depth map, and a point cloud, depth map, or 3D geometry.
This function is similar to M3dmetStat(), but does not require allocating any 3D metrology contexts or result buffers, and does not calculate any statistical metrics based on the distance measurements.
Specifies the source point cloud container or depth map image buffer.
For specifying the point cloud container or depth map
image buffer


Value  Description  
Depth map image buffer identifier 
Specifies the identifier of a depth map image buffer. 

Point cloud container identifier 
Specifies the identifier of a point cloud container. 
Specifies the reference object with respect to which distances will be measured.
For specifying the reference MIL object
identifier


Value  Description  
M_XY_PLANE 
Specifies the XY (Z=0) plane. 

3D geometry object identifier 
Specifies the identifier of a 3D geometry object allocated using M3dgeoAlloc() and defined using M3dgeoBox(), M3dgeoCylinder(), M3dgeoLine(), M3dgeoSphere(), or M3dgeoPlane(). 

Depth map imague buffer identifier 
Specifies the identifier of a depth map image buffer. 

Point cloud container identifier 
Specifies the identifier of a point cloud container. 
See the Parameter associations section for possible values that can be specified.
Specifies the identifier of the buffer in which to store the calculated distances.
The buffer must be a 1band, 32bit floatingpoint image buffer. The destination image buffer must be the same size as the source buffer (or, if the source is a container, the same size as the range component). You can inquire the size of the source object using MbufInquire() (or, for a container, MbufInquireContainer() with M_COMPONENT_RANGE) with M_SIZE_X and M_SIZE_Y. These values can then be used to allocate an image buffer of the correct size.
The image buffer must not have a region of interest (ROI) associated with it.
Note that, if the source object is an image buffer, its X and Y (but not Z) calibration information will be copied into the destination image buffer. Otherwise, the destination image buffer will be uncalibrated.
Specifies the type of distance to calculate.
See the Parameter associations section for possible values that can be specified.
Specifies an optional maximum distance for which to complete calculations when the reference MIL object is a point cloud container. Specify a value if DistanceType is set to M_DISTANCE_TO_MESH or M_DISTANCE_TO_NEAREST_NEIGHBOR; otherwise, set this parameter to M_DEFAULT. Points determined to be further from the reference than this value are assigned a distance of MIL_FLOAT_MAX in the destination, instead of having their exact distances calculated.
For specifying the maximum distance to
calculate


Value  Description  
M_DEFAULT 
Same as M_INFINITE. 

M_INFINITE 
Specifies that there is no maximum distance for which to complete calculations. 

Value > 0.0 
Specifies an optional maximum distance. 
The table below lists possible values for the RefMilObjectId and DistanceType parameters.
To specify the type of distance measurement, the DistanceType parameter can be set to one of the following values, depending on the type of reference object (RefMilObjectId) being measured against.
For specifying the type of distance measurement for
the specified reference object


RefMilObjectId  Description  
DistanceType  
3D box geometry object identfier 
Specifies a 3D box geometry object, allocated using M3dgeoAlloc() and defined using M3dgeoBox(). 

M_ABSOLUTE_DISTANCE_TO_SURFACE 
Specifies to calculate the absolute distance to the surface of the box. 

M_MANHATTAN_DISTANCE_TO_SURFACE 
Specifies to calculate the Manhattan distance to the surface of the box. 

M_SIGNED_DISTANCE_TO_SURFACE 
Specifies to calculate the signed distance to the surface of the box. 

3D cylinder geometry object identifier 
Specifies a 3D cylinder geometry object, allocated using M3dgeoAlloc() and defined using M3dgeoCylinder(). 

M_ABSOLUTE_DISTANCE_TO_SURFACE 
Specifies to calculate the absolute distance to the surface of the cylinder. 

M_DISTANCE_TO_CENTER_AXIS 
Specifies to calculate the signed distance to the cylinder's central axis. 

M_DISTANCE_TO_CENTER_AXIS_SQUARED 
Specifies to calculate the square of the distance to the cylinder's central axis. 

M_SIGNED_DISTANCE_TO_SURFACE 
Specifies to calculate the signed distance to the surface of the cylinder. 

3D line geometry object identifier 
Specifies a 3D line geometry object, allocated using M3dgeoAlloc() and defined using M3dgeoLine(). 

M_DISTANCE_TO_LINE 
Specifies to calculate the distance to the line. 

M_DISTANCE_TO_LINE_SQUARED 
Specifies to calculate the square of the distance to the line. 

3D plane geometry object identifier 
Specifies a 3D plane geometry object, allocated using M3dgeoAlloc() and defined using M3dgeoPlane(). 

M_ABSOLUTE_DISTANCE_TO_SURFACE 
Specifies to calculate the absolute distance, perpendicular to the plane. 

M_ABSOLUTE_DISTANCE_Z_TO_SURFACE 
Specifies to calculate the absolute distance along the Zaxis to the plane. 

M_SIGNED_DISTANCE_TO_SURFACE 
Specifies to calculate the signed distance, perpendicular to the plane. 

M_SIGNED_DISTANCE_Z_TO_SURFACE 
Specifies to calculate the signed distance along the Zaxis to the plane. 

3D sphere geometry object identifier 
Specifies a 3D sphere geometry object, allocated using M3dgeoAlloc() and defined using M3dgeoSphere(). 

M_ABSOLUTE_DISTANCE_TO_SURFACE 
Specifies to calculate the absolute distance to the surface of the sphere. 

M_DISTANCE_TO_CENTER 
Specifies to calculate the signed distance to the center of the sphere. 

M_DISTANCE_TO_CENTER_SQUARED 
Specifies to calculate the square of the distance to the center of the sphere. 

M_SIGNED_DISTANCE_TO_SURFACE 
Specifies to calculate the signed distance to the surface of the sphere. 

Depth map image buffer identifier 
Specifies the identifier of a depth map image buffer. 

M_ABSOLUTE_DISTANCE_Z_TO_SURFACE 
Specifies to calculate the absolute distance to the position in the depth map that is directly above or below the source along the Zaxis. 

M_SIGNED_DISTANCE_Z_TO_SURFACE 
Specifies to calculate the signed distance using the Zcoordinate of the corresponding pixel of the reference depth map. 

Point cloud container identifier 
Specifies a point cloud container, allocated with MbufAllocContainer() with M_PROC. 

M_DISTANCE_TO_MESH 
Specifies to calculate the shortest distance to the reference object's mesh. 

M_DISTANCE_TO_NEAREST_NEIGHBOR 
Specifies to calculate the distance to the nearest point in the reference point cloud. 
Header  Include mil.h. 
Library  Use mil.lib; mil3dmet.lib. 
DLL  Requires mil.dll; mil3dmet.dll. 