 # Help distance between surface

Hi Bro!
how to know distance between 2 surfaces parallel.

Hello,
Assuming the surfaces are offset from one another do you want the diagonal distance between closest points or the perpendicular distance (a) ?

``````   a
<------>
|
|
|

|
|
|
|``````
1 Like

Set a CPlane to one of the two surfaces. Then using Distance, measure the distance from some point on that surface to any point on the other surface. Look at the “CPlane angles and deltas” in the command line, the “dz” value will be the distance between your two (infinite) planes.

1 Like

i know that but I want to choose the surface one after another to return the result of the distance by python script

Have you tried coding this? It’s shouldn’t be too hard. You can get the plane of one of the surfaces - maybe both and check if they are really parallel - then get a point on the second surface and use the rs.DistanceToPlane() method from the point to the first plane. There are also lots of other methods to get the same result.

1 Like

Are the surfaces always planar?

-Pascal

1 Like

That right! They are different in shape but always flat and parallel

Hello - then as @Helvetosaur suggests - get a plane from each - you can get that with Surface.FrameAt(u,v) The u and v could be simply the mid parameter of each surface (Surface.Domain()) then use the origin of one of the planes:

plane1.ClosestPoint(plane2.Origin).DistanceTo(plane2.Origin)

should do it.

But, better to post these questions on the scripting forum…

-Pascal

1 Like

You can draw normal line between these surfaces (Line command > Normal option, Near), and then use Length command to measure its length.

2 Likes