I am trying to project the point on a restricted surface.
Here is what I tried:

Standard_Real umin, umax, vmin, vmax;
BRepTools::UVBounds(aFace,umin, umax, vmin, vmax);
GeomAPI_ProjectPointOnSurf PPS(P,aSurf,umin,umax,vmin,vmax);

It doesn't work because of "unhandled exception".
Any hint will be helpfull. Thanks a lot

Rob Bachrach's picture

I have used this function many times without problem. You might try enclosing your code in a try-catch block and catch Standard_Failure to see if the "unhandled exception" is a CASCADE exception and what kind it is. If in doubt, try your code with a very simple surface (like a rectangle) and try a point within the bounds and close to it.