How to find if a point belongs to a face?

I have a gp_Pnt point and a TopoDS_Face face. How can I find if this point belongs to this face?

I can figure out whether the point belongs to the underlying SURFACE ( through GeomAPI_ProjectPointOnSurf functionality ), but belonging to the surface does not allways implies belonging to the face.

Please help. Thank you in advance


Michael Klokov's picture

Hello, Gershon.

To find if a point belongs to a face project the point on surface of the face. Then check the solution points in following way. If the distance from the original point to solution point is less then the tolerance of the face, then classify the point of projection in 2d space. For this use BRepClass_FaceClassifier. If method State() of BRepClass_FaceClassifier returns TopAbs_IN or TopAbs_ON then the original point belongs to the face.

Best regards, Michael.