Start » Filter Reference » Path » Path Metrics » PathToPathDistance

PathToPathDistance


Module: FoundationPro

Computes the minimum distance between two paths.

Name Type Range Description
Input value
inPath1 Path First input path
Input value
inPath2 Path Second input path
Input value
inPathDistanceMode PathDistanceMode Distance measuring method
Input value
inResolution Real 0.0 -
Output value
outDistance Real Minimal distance between input paths
Output value
outConnectingSegment Segment2D Segment connecting input paths having minimal length

Description

The operation finds the minimal distance between a characteristic point of inPath1 and path inPath2. The distance between a point and a path is computed as follows, depending on the value of inPathDistanceMode:

  • The distance to nearest characteristic point of inPath2, if inPathDistanceMode is set to PointToPoint.
  • The minimal distance to inPath2 segments adjacent to the nearest characteristic point of inPath2 (which is much more precise), if inPathDistanceMode is set to PointToSegment.

The operation computes the outDistance distance and, additionally, the outConnectingSegment line segment corresponding to the result.

Examples

The PathToPathDistance run on the sample paths produces outDistance = 9.509.

The resulting outConnectingSegment drawn onto the input paths.

Errors

This filter can throw an exception to report error. Read how to deal with errors in Error Handling.

List of possible exceptions:

Error type Description
DomainError One or both input paths are empty in PathToPathDistance.

Complexity Level

This filter is available on Basic Complexity Level.

See Also