line between tow points on tow surfaces

Please, I need to create line between tow points on tow surfaces whereas the line length should be as minimum as possible as follow:

1- Enter (x,y) for the first point (input).
1- Pick the point on the first surface.
2- Find the nearest point on the next surface.
3- Create the line.

I was trying to find that in this poor documentation with no luck.

Thanks in advance,

Rob Bachrach's picture

I don't completely understand the steps you outline. However, I believe the BRepExtrema package is what you need. Pay special attention to BRepExtrema_ExtPF which calculates the nearest point(s) on a surface (face) to a point (vertex).

Abraham4D's picture

Thanks Rob so much for your reply.

To make sure you understand the requirement I have drawn and upload the below picture which depict what I need.

http://www.flickr.com/photos/90619911@N00/399916653/

I need to create the lines between two surfaces (which will help me further to identify the material of the object).

Rob Bachrach's picture

So yes, I believe the BRepExtrema classes are what you want.

Abraham4D's picture

Thanks Rob. I really appreciate that and I will try it.