Distance between surface edges

Hello All,

I would like to find distance between surface edges. Is it possible in gh? is there any component available for that. Attached an image for reference. I tried exploding curves and getting distance between end points but not good when sizes of surfaces vary. Please help!

Try Curve->Curve Proximity
You know, you might try actually posting a GH file once in a while, even if its just your geometry…


distance between curves.gh (6.3 KB)

I used the Linear Dimension component from Elefront although I’m sure there are other ways of doing this.


perhaps also closest point, if you get the corner points you can compare each point of one rectangle with each point from the other and the smaller value is your edge distance. Assuming they are alligned like on the picture :wink:

No,… that’s bad idea don’t listen to me :smiley:

yup bad idea it is… I need linear distance

1 Like

Still though, if you select a vertex and the near rectangle, the nearest point. If you measure the distance between that vertex and that nearest point you’ll have what you need :wink:

but wont it be angular, if adjacent surface is bigger or smaller?

Hi Ethan,

Nice work. I agree with you completely that the very least @greatsaiyamandbz could do is post his geometry. Rather rude not to, really.

I don’t have ‘Elefront’ installed so substituted GH’s native LineDim and see that it returns diagonal distances in some cases: Very cool though, it does the job!

Thanks Joseph. I’m sure there are less structured situations where diagonal distances would be essential.


you can try this if works in your case.

Elefront and Vipers plugins used.

Distance Between Surface Edges_RE.gh (96.0 KB)

What angular? I don’t see any angular dimensions in your picture.

I mean end points distance between two surfaces is not linear distance from edge to edge it will be between two points.

Hope it works for rhino 5

No, edge to closest point on a curve, that in such parallel oriented rectangles will be the perpendicular from the edge to the rectangle.

1 Like

This is the improved one.
Tested on large collection of rectangles.
Vipers plugin needed.

Distance Between Surface Edges_RE_2.gh (103.4 KB)

1 Like

This is awesome. Thank you very much!! you are awesome

Thanks this is pretty good. I just posted some random shapes to understand concepts, next time will post the definition definitely, I apologise for that.