How to know whether a point belongs to a curve or a surface ?


I don't find how to check whether a point belongs to a curve or a Surface.

I tried to use GeomAPI_ProjectPointOnCurve and GeomAPI_ProjectPointOnSurf, but this two functions don't work for all case. Sometimes, they don't succeed.

For testing if a point belongs to a Face, I also tried BRepClass_FaceClassifier. But, I don't understand how it works. Indeed if tolerance is less to 1, it always give me a state equal to TopABS_OUT.

I really hope someone could help me,


axyl's picture

Hi franck,
Did you try the folowing?
1. call classes Extrema_ExtPS (extrema between point and surface), Extrema_ExtPC (between curve and surface). These are the classes being used by the API classes you mention above
2. input the point P1 you want to analyse and surface S into Extrema_ExtPC. Your resulting nearest distance is given, say D1
3. compare this value to your tolerance , say 1e-12.
4. if within this distance, you are done, return TRUE

This is true for point-surface, point-curve, etc. From my tests, it works very well. Thus, it may imply there are some troubles with API's? About 'BRepClass_FaceClassifier', read OpenCascade documentation, really well explained! Good luck