🔶Distance Between Two Points

Function Description

This operator calculates the Euclidean distance between two points. It can calculate the straight-line distance in 3D space (XYZ), or consider only specific axes or axial plane projection distances (such as X-axis distance only, Y-axis distance only, Z-axis distance only, XY plane distance, XZ plane distance, YZ plane distance).

Supports multiple input modes: calculate distances between corresponding points in two point lists, calculate the distance between one point and all points in a point list, or calculate the distance between all points in a point list and a fixed point defined in parameters.

Usage Scenarios

  • Distance Measurement: Calculate spatial distance between two positioning points, feature points, or object centers.

  • Conditional Judgment: Make decisions based on whether the distance between two objects or feature points meets specific conditions (e.g., less than safe distance, greater than grasping distance).

  • Relative Positioning: Analyze the distance of one point relative to another point (or fixed reference point) in specific axial directions.

Input/Output

Input

Position One: A list containing one or more 3D point coordinates [X, Y, Z], obtainable from split pick points or pick object pose nodes.

Position Two: A list containing one or more 3D point coordinates [X, Y, Z]. This input port is invalid when the "Calculate Distance to Fixed Point" parameter switch is enabled.

Output

Distance Between Two Points: A list containing the calculated distance values. List length depends on input mode:

  • If input lists have equal length (N vs N), output N distance values.

  • If one input is a single point and the other is N points, output N distance values.

Parameter Description

Input list length matching:

If the calculate distance to fixed point switch is disabled, Position One and Position Two lengths must be equal (e.g., both containing N points, calculating N pairs of point distances), or one list contains only 1 point (calculating distance between this 1 point and all N points in another list). If lengths don’t match and neither is 1, the operator will report an error.

Specify Axis or Axis Combination for Distance Calculation

Parameter Description

Selects which coordinate axes to consider when calculating distance.

Parameter Adjustment

  • XYZ (default): Calculate straight-line distance in 3D space.

  • X / Y / Z: Only calculate distance on a single axis.

  • XY / XZ / YZ: Calculate projected distance on the specified 2D plane.

Calculate Distance to Fixed Point

Parameter Description

Controls whether to calculate distance between two input lists or between input list Position One and a fixed point.

Parameter Adjustment

  • Disable (default): Calculate distance between Position One and Position Two.

  • Enable: Ignore Position Two input port, calculate distance between each point in Position One and the fixed point defined by "Fixed Point Position" parameter.

Fixed Point Position

Parameter Description

Takes effect when "Calculate Distance to Fixed Point" switch is enabled, defining the 3D coordinates [X, Y, Z] of the fixed reference point for distance calculation.

Parameter Adjustment

Enter a fixed 3D coordinate value here, for example [100, 200, 300]. Each point in Position One will calculate distance to this point.