GeomAPI_ProjectPointOnSurf::NbPoints ... gives the same orthogonal projection several times


i receive the uv parameters for an usurface with GeomAPI_ProjectPointOnSurf. My surface is 2d, i mean z=0, when i project a gp_pnt (with z=0, and without z=0) on my surface, normally it should return just one result, cause z=0... but i get many points when i check ::NbPoints(), and all points seems to be the same, the uv are the same.

What is the reason?

thanks in advance.

David B.

François Lauzon's picture

Hello David,
GeomAPI_ProjectPointOnSurf project point orthogonal to a surface, it is possible to have multiple result (think of a sphere for example), but in your case, you should keep only the neareast result, use NearestPoint(), LowerDistanceParameters(U,V) and LowerDistance() to get your result.

For your points all being the same, my guess is that they may not all be the same exactly to every digit, because you have a bezier surface and because of the numerical algorithm used. It's just a guess.

Good Luck,