is point lies on surface or in solid

Good day!
Help please to find a solution to the problem:
How to check whether a point with coordinates XYZ faces TopoDS_Face? Or whether a point lies within a volume TopoDS_Solid?
In advance thanks for your help

Alexander Luger's picture

Check BRepClass3d_SolidClassifier and BRepClass_FaceClassifier.


derevenets.fn's picture

Thank you, Alex!
But still need to apply BRepExtrema_DistShapeShape. This code work:

bool IsPointOnFace(TopoDS_Face aFace, gp_Pnt aPoint, double aTolerance)
TopoDS_Vertex aVertex = BRepBuilderAPI_MakeVertex (aPoint);
BRepExtrema_DistShapeShape anExtrema(aFace, aVertex);
if ((anExtrema.IsDone() == Standard_True) && (anExtrema.Value() <= aTolerance))
BRepClass_FaceClassifier classifier = BRepClass_FaceClassifier(aFace, aPoint, aTolerance);
return ((classifier.State() == TopAbs_ON) || (classifier.State() == TopAbs_IN));
else return false;