About the Geometry.DistanceTo node

I have a question about the Geometry.DistanceTo node.
This node calculates the distance between two geometries. However, I do not know where this distance is calculated from.
For example, is it from the surface of each geometry, from the center of gravity, or something else?
I would like to know how this distance is calculated and what the value is.

I think this is measured from the outsermost point of the elements. And measures to the closest point between them.

1 Like

Yes, at least what I have found out


Here is two polylines in Civil 3D

And it does the same with these two circles

Interesting is that when I tested distance between a 3D polyline and a 2D Polyline I actually got 3D distance


1 Like

@patrick.ericson is correct.

Given two geometrys called A and B, this node basically:

  • Finds the closest point on A to B.
  • Finds the closest point on B to A.
  • Gets the distances from the point on A to the point on B.

The specifics of the method aren’t that (nor are they published), but it serves the purpose of understanding well enough. You can build a generic representation thereof using the Geometry.ClosestPointTo node.

Note that geometry A and B can be any valid non-mesh physical geometry; you can use a Point, Curve, Surface or Solid as either input.

3 Likes

@patrick.ericson @pyXam @jacob.small
Thank you all for the information.

3 Likes