Salome HOME
[bos #35094] [EDF] (2023-T1) X,Y,Z to U,V. Consider face tolerance.
[modules/geom.git] / src / GEOMUtils / GEOMUtils.cxx
index 4abf1f3b33b6e38bbc18eb93adbc17907628099a..35cd7f0fdc505b6e2525d15eee73bdf61d675c87 100644 (file)
@@ -1032,7 +1032,8 @@ Standard_Real GEOMUtils::GetMinDistance
 //=======================================================================
 gp_Pnt GEOMUtils::ProjectPointOnFace(const gp_Pnt& thePoint,
                                      const TopoDS_Shape& theFace,
-                                     double& theU, double& theV)
+                                     double& theU, double& theV,
+                                     const double theTol)
 {
   if (theFace.IsNull() || theFace.ShapeType() != TopAbs_FACE)
     Standard_TypeMismatch::Raise
@@ -1044,7 +1045,7 @@ gp_Pnt GEOMUtils::ProjectPointOnFace(const gp_Pnt& thePoint,
   BRepTools::UVBounds(aFace, U1, U2, V1, V2);
 
   // projector
-  Standard_Real tol = 1.e-4;        
+  Standard_Real tol = Max(theTol, 1.e-4);
   GeomAPI_ProjectPointOnSurf proj;
   proj.Init(surface, U1, U2, V1, V2, tol);
   proj.Perform(thePoint);