diff --git a/src/IntPatch/IntPatch_PrmPrmIntersection.cxx b/src/IntPatch/IntPatch_PrmPrmIntersection.cxx index 7a54be1ebf..8d07c7b2df 100644 --- a/src/IntPatch/IntPatch_PrmPrmIntersection.cxx +++ b/src/IntPatch/IntPatch_PrmPrmIntersection.cxx @@ -353,7 +353,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Point3dDebut = PW.Value(1).Value(); const IntSurf_PntOn2S& PointFin = PW.Value(PW.NbPoints()); Point3dFin = PointFin.Value(); - for( ver = 1 ; (!RejetLigne) && (ver<= NbLigCalculee) ; ver++) { + for( ver = 1 ; ver<= NbLigCalculee ; ver++) { const Handle(IntPatch_WLine)& verwline = *((Handle(IntPatch_WLine)*)&SLin.Value(ver)); // Check end point if it is on existing line. @@ -365,9 +365,11 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& const IntSurf_PntOn2S& verPointDebut = verwline->Point(1); const IntSurf_PntOn2S& verPointFin = verwline->Point(verwline->NbPnts()); - if( Point3dDebut.Distance(verPointDebut.Value()) <= TolTangency ) { - if(Point3dFin.Distance(verPointFin.Value()) <= TolTangency) - RejetLigne = Standard_True; + if( (Point3dDebut.Distance(verPointDebut.Value()) <= TolTangency) && + (Point3dFin.Distance(verPointFin.Value()) <= TolTangency)) + { + RejetLigne = Standard_True; + break; } } @@ -496,7 +498,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Point3dDebut = PW.Value(1).Value(); const IntSurf_PntOn2S& PointFin = PW.Value(PW.NbPoints()); Point3dFin = PointFin.Value(); - for(ver=1 ; (!RejetLigne) && (ver<= NbLigCalculee) ; ver++) { + for(ver=1 ; ver<= NbLigCalculee ; ver++) { const Handle(IntPatch_WLine)& verwline = *((Handle(IntPatch_WLine)*)&SLin.Value(ver)); // Check end point if it is on existing line. @@ -508,11 +510,11 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& const IntSurf_PntOn2S& verPointDebut = verwline->Point(1); const IntSurf_PntOn2S& verPointFin = verwline->Point(verwline->NbPnts()); - if(Point3dDebut.Distance(verPointDebut.Value()) < TolTangency) + if( (Point3dDebut.Distance(verPointDebut.Value()) < TolTangency) || + (Point3dFin.Distance(verPointFin.Value()) < TolTangency)) + { RejetLigne = Standard_True; - else { - if(Point3dFin.Distance(verPointFin.Value()) < TolTangency) - RejetLigne = Standard_True; + break; } } @@ -726,15 +728,15 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& RejetLigne = Standard_False; Point3dDebut = PW.Value(1).Value(); Point3dFin = PW.Value(PW.NbPoints()).Value(); - for(ver=1 ; (!RejetLigne) && (ver<= NbLigCalculee) ; ver++) { + for(ver=1 ; ver<= NbLigCalculee ; ver++) { const Handle(IntPatch_WLine)& verwline = *((Handle(IntPatch_WLine)*)&SLin.Value(ver)); const IntSurf_PntOn2S& verPointDebut = verwline->Point(1); const IntSurf_PntOn2S& verPointFin = verwline->Point(verwline->NbPnts()); - if(Point3dDebut.Distance(verPointDebut.Value()) < TolTangency) + if( (Point3dDebut.Distance(verPointDebut.Value()) < TolTangency) || + (Point3dFin.Distance(verPointFin.Value()) < TolTangency)) + { RejetLigne = Standard_True; - else { - if(Point3dFin.Distance(verPointFin.Value()) < TolTangency) - RejetLigne = Standard_True; + break; } } @@ -899,15 +901,15 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& RejetLigne = Standard_False; Point3dDebut = PW.Value(1).Value(); Point3dFin = PW.Value(PW.NbPoints()).Value(); - for( ver = 1 ; (!RejetLigne) && (ver<= NbLigCalculee) ; ver++) { + for( ver = 1 ; ver<= NbLigCalculee ; ver++) { const Handle(IntPatch_WLine)& verwline = *((Handle(IntPatch_WLine)*)&SLin.Value(ver)); const IntSurf_PntOn2S& verPointDebut = verwline->Point(1); const IntSurf_PntOn2S& verPointFin = verwline->Point(verwline->NbPnts()); - if(Point3dDebut.Distance(verPointDebut.Value()) < TolTangency) + if( (Point3dDebut.Distance(verPointDebut.Value()) < TolTangency) || + (Point3dFin.Distance(verPointFin.Value()) < TolTangency)) + { RejetLigne = Standard_True; - else { - if(Point3dFin.Distance(verPointFin.Value()) < TolTangency) - RejetLigne = Standard_True; + break; } } @@ -1533,7 +1535,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Point3dDebut = PW.Value(1).Value(); const IntSurf_PntOn2S& PointFin = PW.Value(PW.NbPoints()); Point3dFin = PointFin.Value(); - for( ver = 1 ; (!RejetLigne) && (ver<= NbLigCalculee) ; ver++) { + for( ver = 1 ; ver<= NbLigCalculee ; ver++) { const Handle(IntPatch_WLine)& verwline = *((Handle(IntPatch_WLine)*)&SLin.Value(ver)); // Check end point if it is on existing line. @@ -1545,9 +1547,11 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& const IntSurf_PntOn2S& verPointDebut = verwline->Point(1); const IntSurf_PntOn2S& verPointFin = verwline->Point(verwline->NbPnts()); - if(Point3dDebut.Distance(verPointDebut.Value()) <= TolTangency) { - if(Point3dFin.Distance(verPointFin.Value()) <= TolTangency) - RejetLigne = Standard_True; + if( (Point3dDebut.Distance(verPointDebut.Value()) <= TolTangency) && + (Point3dFin.Distance(verPointFin.Value()) <= TolTangency)) + { + RejetLigne = Standard_True; + break; } } @@ -2356,6 +2360,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur //modified by NIZNHY-PKV Tue May 10 11:08:13 2011t RejectLine = Standard_True; + ver--; break; } }//for(m=1; mPoint(1); const IntSurf_PntOn2S& verPointFin = verwline->Point(verwline->NbPnts()); - if(Point3dDebut.Distance(verPointDebut.Value()) < TolTangency) + if( (Point3dDebut.Distance(verPointDebut.Value()) < TolTangency) || + (Point3dFin.Distance(verPointFin.Value()) < TolTangency)) { RejetLigne = Standard_True; - } - else - { - if(Point3dFin.Distance(verPointFin.Value()) < TolTangency) - { - RejetLigne = Standard_True; - } + break; } } diff --git a/tests/bugs/fclasses/bug670 b/tests/bugs/fclasses/bug670 index 8b029d5d8b..0768718bb5 100755 --- a/tests/bugs/fclasses/bug670 +++ b/tests/bugs/fclasses/bug670 @@ -1,5 +1,6 @@ puts "TODO ?OCC12345 ALL: An exception was caught" puts "TODO ?OCC12345 ALL: \\*\\* Exception \\*\\*.*" +puts "TODO ?OCC12345 ALL: TEST INCOMPLETE" puts "========" puts "OCC670" diff --git a/tests/bugs/modalg_5/bug25951 b/tests/bugs/modalg_5/bug25951 new file mode 100644 index 0000000000..4dd0adc57d --- /dev/null +++ b/tests/bugs/modalg_5/bug25951 @@ -0,0 +1,23 @@ +puts "========" +puts "OCC25951" +puts "========" +puts "" +####################################### +# Exception in intersection operation +####################################### + +restore [locate_data_file OCC25951-qff001.brep] q +explode q +copy q_1 b1 +copy q_2 b2 +bsection result b1 b2 + +set nb_v_good 1 +set nb_e_good 0 +set nb_w_good 0 +set nb_f_good 0 +set nb_sh_good 0 +set nb_sol_good 0 +set nb_compsol_good 0 +set nb_compound_good 1 +set nb_shape_good 2