From: razmyslovich Date: Wed, 14 May 2014 11:30:02 +0000 (+0200) Subject: 0024922: ShapeAnalysis_Wire::CheckIntersectingEdges doesn't report an intersection... X-Git-Tag: V6_8_0_beta~320 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=16a1f2653700911a553ab4c4b9b0e833b8b32496;p=occt-copy.git 0024922: ShapeAnalysis_Wire::CheckIntersectingEdges doesn't report an intersection point if it is inside of tolerance even only on edge Fix the tolerances check for an intersection point in ShapeAnalysis_Wire::CheckIntersectingEdges --- diff --git a/src/ShapeAnalysis/ShapeAnalysis_Wire.cxx b/src/ShapeAnalysis/ShapeAnalysis_Wire.cxx index 9e31ed785e..905fa6adf5 100644 --- a/src/ShapeAnalysis/ShapeAnalysis_Wire.cxx +++ b/src/ShapeAnalysis/ShapeAnalysis_Wire.cxx @@ -1407,15 +1407,22 @@ Standard_Boolean ShapeAnalysis_Wire::CheckIntersectingEdges(const Standard_Integ Standard_Real param2 = IP.ParamOnSecond(); gp_Pnt pi1 = GetPointOnEdge ( edge1, mySurf, Crv1, param1 ); //:h0: thesurf.Value ( Crv1->Value ( param1 ) ); gp_Pnt pi2 = GetPointOnEdge ( edge2, mySurf, Crv2, param2 ); - Standard_Boolean OK = Standard_False; - for(Standard_Integer j=1; (j<=4)&&!OK; j++) { + Standard_Boolean OK1 = Standard_False; + Standard_Boolean OK2 = Standard_False; + + for(Standard_Integer j=1; (j<=2)&&!OK1; j++) { Standard_Real di1 = pi1.SquareDistance (vertexPoints(j)); + if(di1 < vertexTolers(j) * vertexTolers(j)) + OK1 = Standard_True; + } + + for(Standard_Integer j=3; (j<=4)&&!OK2; j++) { Standard_Real di2 = pi2.SquareDistance (vertexPoints(j)); - Standard_Real dist2 = Max ( di1, di2 ); - if(dist2 < vertexTolers(j) * vertexTolers(j)) - OK = Standard_True; + if(di2 < vertexTolers(j) * vertexTolers(j)) + OK2 = Standard_True; } - if(!OK) { + + if(!OK1 || !OK2) { gp_Pnt pint = 0.5 * ( pi1.XYZ() + pi2.XYZ() ); points2d.Append ( IP ); points3d.Append ( pint );