measure_distance
Calculates the minimum distance in millimeters between two FreeCAD entities or sub-shapes, returning closest points and touch status to verify gaps and clearances.
Instructions
Minimum distance between two entities, in mm. The workhorse measurement tool: lets a blind agent verify gaps, clearances, and contact.
Args:
a: handle of the first object.
b: handle of the second object.
a_ref: optional sub-shape selector on a to measure FROM instead of the
whole solid -- an f_* face tag, an e_* edge tag, or a literal
"FaceN"/"EdgeN" (1-based). Omit to use the whole shape.
b_ref: optional sub-shape selector on b (same forms as a_ref).
Measures the minimum (closest-approach) distance, so distance_mm = 0 means the two entities touch or interpenetrate. This does NOT report overlap volume -- use min_clearance / interference_check for penetration depth.
Returns a dict (no handle; this is a measurement): distance_mm: float -- minimum gap in mm (0.0 when touching/intersecting). point_on_a: [x, y, z] mm -- closest point on a (or its sub-shape). point_on_b: [x, y, z] mm -- closest point on b (or its sub-shape). touching: bool -- True when distance_mm < 1e-7.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes | ||
| a_ref | No | ||
| b_ref | No |