0026621: Boolean Cut does not work on two solids
authornbv <nbv@opencascade.com>
Thu, 10 Sep 2015 14:39:38 +0000 (17:39 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 10 Sep 2015 14:40:33 +0000 (17:40 +0300)
The main reason of the bug is incorrect extending line in SeveralWlinesProcessing(...) function.

Additionally, interface of IntPatch_WLine::Dump(...) method has been changed.

Change some test cases according to their new behavior.

Test-case for issue #26621

src/IntPatch/IntPatch_PrmPrmIntersection.cxx
src/IntPatch/IntPatch_WLine.cxx
src/IntPatch/IntPatch_WLine.hxx
src/IntTools/IntTools_FaceFace.cxx
tests/bugs/modalg_5/bug25319_1
tests/bugs/modalg_5/bug25319_2
tests/bugs/modalg_6/bug26621 [new file with mode: 0644]

index 377e612..c68e8d5 100644 (file)
@@ -70,6 +70,188 @@ static void AddWLine(IntPatch_SequenceOfLine      &theLines,
                      const Handle(IntPatch_WLine) &theWLine,
                      const Standard_Real           Deflection);
 
+static void SeveralWlinesProcessing(const Handle(Adaptor3d_HSurface)& theSurf1,
+                                    const Handle(Adaptor3d_HSurface)& theSurf2,
+                                    const IntPatch_SequenceOfLine& theSLin,
+                                    const Standard_Real* const thePeriodsArr,
+                                    const IntSurf_TypeTrans theTrans1,
+                                    const IntSurf_TypeTrans theTrans2,
+                                    const Standard_Real theTol,
+                                    Handle(IntPatch_WLine)& theWLline)
+{
+  if(theSLin.Length() == 0)
+    return;
+
+  Standard_Real aU1 = 0.0, aV1 = 0.0, aU2 = 0.0, aV2 = 0.0;
+
+  const Standard_Real aTol2D = 1.e-4;
+  Standard_Integer cnbV = theWLline->NbVertex();
+  Standard_Integer ciV;
+  for( ciV = 1; ciV <= cnbV; ciV++ )
+  {
+    Standard_Real pntDMin = 1.e+100;
+    Standard_Integer VDMin = 0;
+    Standard_Integer WLDMin = 0;
+    gp_Pnt cPV = theWLline->Vertex(ciV).Value();
+    theWLline->Vertex(ciV).Parameters(aU1, aV1, aU2, aV2);
+    const gp_Pnt2d aPCS1(aU1, aV1), aPCS2(aU2, aV2);
+    Standard_Integer iL;
+    for( iL = 1; iL <= theSLin.Length(); iL++)
+    {
+      const Handle(IntPatch_Line)& aSLine = theSLin.Value(iL);
+      IntPatch_IType aType = aSLine->ArcType();
+      if( aType != IntPatch_Walking)
+        continue;
+      const Handle(IntPatch_WLine) aWLine = Handle(IntPatch_WLine)::DownCast(aSLine);
+      Standard_Integer tnbV = aWLine->NbVertex();
+      Standard_Integer tiV;
+      for( tiV = 1; tiV <= tnbV; tiV++ )
+      {
+        gp_Pnt tPV = aWLine->Vertex(tiV).Value();
+
+        aWLine->Vertex(tiV).Parameters(aU1, aV1, aU2, aV2);
+        const gp_Pnt2d aPTS1(aU1, aV1), aPTS2(aU2, aV2);
+
+        Standard_Real tDistance = cPV.Distance(tPV);
+        Standard_Real uRs1 = theSurf1->Surface().UResolution(tDistance);
+        Standard_Real vRs1 = theSurf1->Surface().VResolution(tDistance);
+        Standard_Real uRs2 = theSurf2->Surface().UResolution(tDistance);
+        Standard_Real vRs2 = theSurf2->Surface().VResolution(tDistance);
+        Standard_Real RmaxS1 = Max(uRs1,vRs1);
+        Standard_Real RmaxS2 = Max(uRs2,vRs2);
+        if((aPCS1.SquareDistance(aPTS1) < RmaxS1*RmaxS1) && (aPCS2.SquareDistance(aPTS2) < RmaxS2*RmaxS2))
+        {
+          if(RmaxS1 < aTol2D && RmaxS2 < aTol2D)
+          {
+            if( pntDMin > tDistance && tDistance > 1.e-9)
+            {
+              pntDMin = tDistance;
+              VDMin = tiV;
+              WLDMin = iL;
+            }
+          }
+        }
+      }
+    }
+
+    if( VDMin != 0 )
+    {
+      const Handle(IntPatch_Line)& aSLine = theSLin.Value(WLDMin);
+      const Handle(IntPatch_WLine) aWLine = Handle(IntPatch_WLine)::DownCast(aSLine);
+      Standard_Integer tiVpar = (Standard_Integer)aWLine->Vertex(VDMin).ParameterOnLine();
+      Standard_Integer ciVpar = (Standard_Integer)theWLline->Vertex(ciV).ParameterOnLine();
+      Standard_Real u11 = 0., u12 = 0., v11 = 0., v12 = 0.;
+      Standard_Real u21 = 0., u22 = 0., v21 = 0., v22 = 0.;
+      theWLline->Point(ciVpar).Parameters(u11,v11,u12,v12);
+      aWLine->Point(tiVpar).Parameters(u21,v21,u22,v22);
+
+      Handle(IntSurf_LineOn2S) newL2s = new IntSurf_LineOn2S();
+      IntSurf_PntOn2S replacePnt = aWLine->Point(tiVpar);
+      Standard_Integer cNbP = theWLline->NbPnts();
+
+      TColStd_SequenceOfInteger VPold;
+      Standard_Integer iPo;
+      for( iPo = 1; iPo <= cnbV; iPo++ )
+      {
+        Standard_Real Po = theWLline->Vertex(iPo).ParameterOnLine();
+        Standard_Integer IPo = (Standard_Integer) Po;
+        VPold.Append(IPo);
+      }
+
+      Standard_Boolean removeNext = Standard_False;
+      Standard_Boolean removePrev = Standard_False;
+      if( ciV == 1)
+      {
+        Standard_Integer dPar = Abs( VPold.Value(ciV) - VPold.Value(ciV+1));
+        if(dPar > 10)
+        {
+          removeNext = Standard_True;
+          for( iPo = (ciV+1); iPo <= cnbV; iPo++ )
+            VPold.SetValue(iPo, VPold.Value(iPo) - 1 );
+        }
+      }
+      else if( ciV == cnbV)
+      {
+        Standard_Integer dPar = Abs( VPold.Value(ciV) - VPold.Value(ciV-1));
+        if(dPar > 10)
+        {
+          removePrev = Standard_True;
+          VPold.SetValue(ciV, VPold.Value(ciV) - 1 );
+        }
+      }
+      else
+      {
+        Standard_Integer dParMi = Abs( VPold.Value(ciV) - VPold.Value(ciV-1));
+        Standard_Integer dParMa = Abs( VPold.Value(ciV) - VPold.Value(ciV+1));
+        if(dParMi > 10)
+        {
+          removePrev = Standard_True;
+          VPold.SetValue(ciV, VPold.Value(ciV) - 1 );
+        }
+
+        if(dParMa > 10)
+        {
+          removeNext = Standard_True;
+          for( iPo = (ciV+1); iPo <= cnbV; iPo++ )
+          {
+            if(dParMi > 10)
+              VPold.SetValue(iPo, VPold.Value(iPo) - 2 );
+            else
+              VPold.SetValue(iPo, VPold.Value(iPo) - 1 );
+          }
+        }
+        else
+        {
+          if(dParMi > 10)
+            for( iPo = (ciV+1); iPo <= cnbV; iPo++ )
+              VPold.SetValue(iPo, VPold.Value(iPo) - 1 );
+        } 
+      }
+
+      Standard_Integer pI = ciVpar;
+
+      Standard_Integer iP;
+      for( iP = 1; iP <= cNbP; iP++)
+      {
+        if( pI == iP )
+        {
+          IntSurf_PntOn2S newPnt = MakeNewPoint(replacePnt, theWLline->Point(iP), thePeriodsArr);
+          newL2s->Add(newPnt);
+        }
+        else if(removeNext && iP == (pI + 1))
+          continue;
+        else if(removePrev && iP == (pI - 1))
+          continue;
+        else
+          newL2s->Add(theWLline->Point(iP));
+      }
+
+      IntPatch_Point newVtx;
+      gp_Pnt Pnt3dV = aWLine->Vertex(VDMin).Value();
+      newVtx.SetValue(Pnt3dV,theTol,Standard_False);
+      newVtx.SetParameters(u21,v21,u22,v22);
+      newVtx.SetParameter(VPold.Value(ciV));
+
+      Handle(IntPatch_WLine) NWLine = new IntPatch_WLine(newL2s,Standard_False,theTrans1,theTrans2);
+
+      Standard_Integer iV;
+      for( iV = 1; iV <= cnbV; iV++ )
+      {
+        if( iV == ciV )
+          NWLine->AddVertex(newVtx);
+        else
+        {
+          IntPatch_Point theVtx = theWLline->Vertex(iV);
+          theVtx.SetParameter(VPold.Value(iV));
+          NWLine->AddVertex(theVtx);
+        }
+      }
+
+      theWLline = NWLine;
+    }//if( VDMin != 0 )
+  }//for( ciV = 1; ciV <= cnbV; ciV++ )
+}
+
 //=======================================================================
 //function : DublicateOfLinesProcessing
 //purpose  : Decides, if rejecting current line is necessary
@@ -1608,144 +1790,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)&
                 wline->AddVertex(vtx);
               }              
 
-              Standard_Integer slinlen = SLin.Length();
-              if( slinlen > 0 ) {
-                Standard_Integer cnbV = wline->NbVertex();
-                Standard_Integer ciV;
-                for( ciV = 1; ciV <= cnbV; ciV++ ) {
-                  Standard_Real pntDMin = 1.e+100;
-                  Standard_Integer VDMin = 0;
-                  Standard_Integer WLDMin = 0;
-                  gp_Pnt cPV = wline->Vertex(ciV).Value();
-                  Standard_Integer iL;
-                  for( iL = 1; iL <= slinlen; iL++) {
-                    const Handle(IntPatch_Line)& aSLine = SLin.Value(iL);
-                    IntPatch_IType aType = aSLine->ArcType();
-                    if( aType != IntPatch_Walking)
-                      continue;
-                    Handle(IntPatch_WLine) aWLine (Handle(IntPatch_WLine)::DownCast (aSLine));
-                    Standard_Integer tnbV = aWLine->NbVertex();
-                    Standard_Integer tiV;
-                    for( tiV = 1; tiV <= tnbV; tiV++ ) {
-                      gp_Pnt tPV = aWLine->Vertex(tiV).Value();
-                      Standard_Real tDistance = cPV.Distance(tPV);
-                      Standard_Real uRs1 = Surf1->Surface().UResolution(tDistance);
-                      Standard_Real vRs1 = Surf1->Surface().VResolution(tDistance);
-                      Standard_Real uRs2 = Surf2->Surface().UResolution(tDistance);
-                      Standard_Real vRs2 = Surf2->Surface().VResolution(tDistance);
-                      Standard_Real RmaxS1 = Max(uRs1,vRs1);
-                      Standard_Real RmaxS2 = Max(uRs2,vRs2);
-                      if(RmaxS1 < 1.e-4 && RmaxS2 < 1.e-4) {
-                        if( pntDMin > tDistance && tDistance > 1.e-9) {
-                          pntDMin = tDistance;
-                          VDMin = tiV;
-                          WLDMin = iL;
-                        }
-                      }
-                    }
-                  }
-
-                  if( VDMin != 0 ) {
-                    const Handle(IntPatch_Line)& aSLine = SLin.Value(WLDMin);
-                    Handle(IntPatch_WLine) aWLine (Handle(IntPatch_WLine)::DownCast (aSLine));
-                    Standard_Integer tiVpar = (Standard_Integer)aWLine->Vertex(VDMin).ParameterOnLine();
-                    Standard_Integer ciVpar = (Standard_Integer)wline->Vertex(ciV).ParameterOnLine();
-                    Standard_Real u11 = 0., u12 = 0., v11 = 0., v12 = 0.;
-                    Standard_Real u21 = 0., u22 = 0., v21 = 0., v22 = 0.;
-                    wline->Point(ciVpar).Parameters(u11,v11,u12,v12);
-                    aWLine->Point(tiVpar).Parameters(u21,v21,u22,v22);
-
-                    Handle(IntSurf_LineOn2S) newL2s = new IntSurf_LineOn2S();
-                    IntSurf_PntOn2S replacePnt = aWLine->Point(tiVpar);
-                    Standard_Integer cNbP = wline->NbPnts();
-
-                    TColStd_SequenceOfInteger VPold;
-                    Standard_Integer iPo;
-                    for( iPo = 1; iPo <= cnbV; iPo++ ) {
-                      Standard_Real Po = wline->Vertex(iPo).ParameterOnLine();
-                      Standard_Integer IPo = (Standard_Integer) Po;
-                      VPold.Append(IPo);
-                    }
-
-                    Standard_Boolean removeNext = Standard_False;
-                    Standard_Boolean removePrev = Standard_False;
-                    if( ciV == 1) {
-                      Standard_Integer dPar = Abs( VPold.Value(ciV) - VPold.Value(ciV+1));
-                      if(dPar > 10) {
-                        removeNext = Standard_True;
-                        for( iPo = (ciV+1); iPo <= cnbV; iPo++ )
-                          VPold.SetValue(iPo, VPold.Value(iPo) - 1 );
-                      }
-                    }
-                    else if( ciV == cnbV) {
-                      Standard_Integer dPar = Abs( VPold.Value(ciV) - VPold.Value(ciV-1));
-                      if(dPar > 10) {
-                        removePrev = Standard_True;
-                        VPold.SetValue(ciV, VPold.Value(ciV) - 1 );
-                      }
-                    }
-                    else {
-                      Standard_Integer dParMi = Abs( VPold.Value(ciV) - VPold.Value(ciV-1));
-                      Standard_Integer dParMa = Abs( VPold.Value(ciV) - VPold.Value(ciV+1));
-                      if(dParMi > 10) {
-                        removePrev = Standard_True;
-                        VPold.SetValue(ciV, VPold.Value(ciV) - 1 );
-                      }
-                      if(dParMa > 10) {
-                        removeNext = Standard_True;
-                        for( iPo = (ciV+1); iPo <= cnbV; iPo++ ) {
-                          if(dParMi > 10)
-                            VPold.SetValue(iPo, VPold.Value(iPo) - 2 );
-                          else
-                            VPold.SetValue(iPo, VPold.Value(iPo) - 1 );
-                        }
-                      }
-                      else {
-                        if(dParMi > 10)
-                          for( iPo = (ciV+1); iPo <= cnbV; iPo++ )
-                            VPold.SetValue(iPo, VPold.Value(iPo) - 1 );
-                      } 
-                    }
-                    Standard_Integer pI = (Standard_Integer) ciVpar;
-
-                    Standard_Integer iP;
-                    for( iP = 1; iP <= cNbP; iP++) {
-                      if( pI == iP )
-                      {
-                        IntSurf_PntOn2S newPnt = MakeNewPoint(replacePnt, wline->Point(iP), Periods);
-                        newL2s->Add(newPnt);
-                      }
-                      else if(removeNext && iP == (pI + 1))
-                        continue;
-                      else if(removePrev && iP == (pI - 1))
-                        continue;
-                      else
-                        newL2s->Add(wline->Point(iP));
-                    }
-
-                    IntPatch_Point newVtx;
-                    gp_Pnt Pnt3dV = aWLine->Vertex(VDMin).Value();
-                    newVtx.SetValue(Pnt3dV,TolTang,Standard_False);
-                    newVtx.SetParameters(u21,v21,u22,v22);
-                    newVtx.SetParameter(VPold.Value(ciV));
-
-                    Handle(IntPatch_WLine) NWLine = new IntPatch_WLine(newL2s,Standard_False,trans1,trans2);
-
-                    Standard_Integer iV;
-                    for( iV = 1; iV <= cnbV; iV++ ) {
-                      if( iV == ciV )
-                        NWLine->AddVertex(newVtx);
-                      else {
-                        IntPatch_Point theVtx = wline->Vertex(iV);
-                        theVtx.SetParameter(VPold.Value(iV));
-                        NWLine->AddVertex(theVtx);
-                      }
-                    }
-
-                    wline = NWLine;
-                  }
-                }
-              }// SLin.Length > 0
+              SeveralWlinesProcessing(Surf1, Surf2, SLin, Periods, trans1, trans2, TolTang, wline);
 
               AddWLine(SLin, wline, Deflection);
               empt = Standard_False;
@@ -2425,166 +2470,7 @@ void IntPatch_PrmPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
 
                       lignetrouvee = Standard_True;
 
-                      Standard_Integer slinlen = SLin.Length();
-                      if( slinlen > 0 )
-                      {
-                        Standard_Integer cnbV = wline->NbVertex();
-                        Standard_Integer ciV;
-                        for( ciV = 1; ciV <= cnbV; ciV++ )
-                        {
-                          Standard_Real pntDMin = 1.e+100;
-                          Standard_Integer VDMin = 0;
-                          Standard_Integer WLDMin = 0;
-                          gp_Pnt cPV = wline->Vertex(ciV).Value();
-                          Standard_Integer iL;
-                          for( iL = 1; iL <= slinlen; iL++)
-                          {
-                            const Handle(IntPatch_Line)& aSLine = SLin.Value(iL);
-                            IntPatch_IType aType = aSLine->ArcType();
-                            if( aType != IntPatch_Walking)
-                              continue;
-                            Handle(IntPatch_WLine) aWLine (Handle(IntPatch_WLine)::DownCast (aSLine));
-                            Standard_Integer tnbV = aWLine->NbVertex();
-                            Standard_Integer tiV;
-                            for( tiV = 1; tiV <= tnbV; tiV++ )
-                            {
-                              gp_Pnt tPV = aWLine->Vertex(tiV).Value();
-                              Standard_Real tDistance = cPV.Distance(tPV);
-                              Standard_Real uRs1 = Surf1->Surface().UResolution(tDistance);
-                              Standard_Real vRs1 = Surf1->Surface().VResolution(tDistance);
-                              Standard_Real uRs2 = Surf2->Surface().UResolution(tDistance);
-                              Standard_Real vRs2 = Surf2->Surface().VResolution(tDistance);
-                              Standard_Real RmaxS1 = Max(uRs1,vRs1);
-                              Standard_Real RmaxS2 = Max(uRs2,vRs2);
-                              if(RmaxS1 < 1.e-4 && RmaxS2 < 1.e-4)
-                              {
-                                if( pntDMin > tDistance && tDistance > 1.e-9)
-                                {
-                                  pntDMin = tDistance;
-                                  VDMin = tiV;
-                                  WLDMin = iL;
-                                }
-                              }
-                            }
-                          }
-
-                          if( VDMin != 0 )
-                          {
-                            const Handle(IntPatch_Line)& aSLine = SLin.Value(WLDMin);
-                            Handle(IntPatch_WLine) aWLine (Handle(IntPatch_WLine)::DownCast (aSLine));
-                            Standard_Integer tiVpar = (Standard_Integer)aWLine->Vertex(VDMin).ParameterOnLine();
-                            Standard_Integer ciVpar = (Standard_Integer)wline->Vertex(ciV).ParameterOnLine();
-                            Standard_Real u11 = 0., u12 = 0., v11 = 0., v12 = 0.;
-                            Standard_Real u21 = 0., u22 = 0., v21 = 0., v22 = 0.;
-                            wline->Point(ciVpar).Parameters(u11,v11,u12,v12);
-                            aWLine->Point(tiVpar).Parameters(u21,v21,u22,v22);
-
-                            Handle(IntSurf_LineOn2S) newL2s = new IntSurf_LineOn2S();
-                            IntSurf_PntOn2S replacePnt = aWLine->Point(tiVpar);
-                            Standard_Integer cNbP = wline->NbPnts();
-
-                            TColStd_SequenceOfInteger VPold;
-                            Standard_Integer iPo;
-                            for( iPo = 1; iPo <= cnbV; iPo++ )
-                            {
-                              Standard_Real Po = wline->Vertex(iPo).ParameterOnLine();
-                              Standard_Integer IPo = (Standard_Integer) Po;
-                              VPold.Append(IPo);
-                            }
-
-                            Standard_Boolean removeNext = Standard_False;
-                            Standard_Boolean removePrev = Standard_False;
-                            if( ciV == 1)
-                            {
-                              Standard_Integer dPar = Abs( VPold.Value(ciV) - VPold.Value(ciV+1));
-                              if(dPar > 10)
-                              {
-                                removeNext = Standard_True;
-                                for( iPo = (ciV+1); iPo <= cnbV; iPo++ )
-                                  VPold.SetValue(iPo, VPold.Value(iPo) - 1 );
-                              }
-                            }
-                            else if( ciV == cnbV)
-                            {
-                              Standard_Integer dPar = Abs( VPold.Value(ciV) - VPold.Value(ciV-1));
-                              if(dPar > 10)
-                              {
-                                removePrev = Standard_True;
-                                VPold.SetValue(ciV, VPold.Value(ciV) - 1 );
-                              }
-                            }
-                            else
-                            {
-                              Standard_Integer dParMi = Abs( VPold.Value(ciV) - VPold.Value(ciV-1));
-                              Standard_Integer dParMa = Abs( VPold.Value(ciV) - VPold.Value(ciV+1));
-                              if(dParMi > 10)
-                              {
-                                removePrev = Standard_True;
-                                VPold.SetValue(ciV, VPold.Value(ciV) - 1 );
-                              }
-
-                              if(dParMa > 10)
-                              {
-                                removeNext = Standard_True;
-                                for( iPo = (ciV+1); iPo <= cnbV; iPo++ )
-                                {
-                                  if(dParMi > 10)
-                                    VPold.SetValue(iPo, VPold.Value(iPo) - 2 );
-                                  else
-                                    VPold.SetValue(iPo, VPold.Value(iPo) - 1 );
-                                }
-                              }
-                              else
-                              {
-                                if(dParMi > 10)
-                                  for( iPo = (ciV+1); iPo <= cnbV; iPo++ )
-                                    VPold.SetValue(iPo, VPold.Value(iPo) - 1 );
-                              } 
-                            }
-
-                            Standard_Integer pI = ciVpar;
-
-                            Standard_Integer iP;
-                            for( iP = 1; iP <= cNbP; iP++)
-                            {
-                              if( pI == iP )
-                              {
-                                IntSurf_PntOn2S newPnt = MakeNewPoint(replacePnt, wline->Point(iP), Periods);
-                                newL2s->Add(newPnt);
-                              }
-                              else if(removeNext && iP == (pI + 1))
-                                continue;
-                              else if(removePrev && iP == (pI - 1))
-                                continue;
-                              else
-                                newL2s->Add(wline->Point(iP));
-                            }
-
-                            IntPatch_Point newVtx;
-                            gp_Pnt Pnt3dV = aWLine->Vertex(VDMin).Value();
-                            newVtx.SetValue(Pnt3dV,TolTang,Standard_False);
-                            newVtx.SetParameters(u21,v21,u22,v22);
-                            newVtx.SetParameter(VPold.Value(ciV));
-
-                            Handle(IntPatch_WLine) NWLine = new IntPatch_WLine(newL2s,Standard_False,trans1,trans2);
-
-                            Standard_Integer iV;
-                            for( iV = 1; iV <= cnbV; iV++ )
-                            {
-                              if( iV == ciV )
-                                NWLine->AddVertex(newVtx);
-                              else
-                              {
-                                IntPatch_Point theVtx = wline->Vertex(iV);
-                                theVtx.SetParameter(VPold.Value(iV));
-                                NWLine->AddVertex(theVtx);
-                              }
-                            }
-
-                            wline = NWLine;
-                          }//if( VDMin != 0 )
-                        }//for( ciV = 1; ciV <= cnbV; ciV++ )
-                      }// SLin.Length > 0
+                      SeveralWlinesProcessing(Surf1, Surf2, SLin, Periods, trans1, trans2, TolTang, wline);
 
                       AddWLine(SLin, wline, Deflection);
                       empt = Standard_False;
index ffbe31f..0a8094d 100644 (file)
@@ -1073,40 +1073,70 @@ const Handle(Adaptor2d_HCurve2d)& IntPatch_WLine::GetArcOnS2() const  {
 }
 
 
-void IntPatch_WLine::Dump() const { 
-  
-  cout<<" ----------- D u m p    I n t P a t c h  _  W L i n e  --------------"<<endl;
-  Standard_Integer i;
-  Standard_Integer nbp = NbPnts();
-  printf("Num    [X  Y  Z]     [U1  V1]   [U2  V2]\n");
-//  for(Standard_Integer i=1;i<=nbp;i++) { 
-  for(i=1;i<=nbp;i++) {
-    Standard_Real u1,v1,u2,v2;
-    Point(i).Parameters(u1,v1,u2,v2);
-    printf("%4d  [%+10.20f %+10.20f %+10.20f]  [%+10.20f %+10.20f]  [%+10.20f %+10.20f]\n",
-          i,
-          Point(i).Value().X(),
-          Point(i).Value().Y(),
-          Point(i).Value().Z(),
-          u1,v1,u2,v2);
-    
+void IntPatch_WLine::Dump(const Standard_Integer theMode) const
+{ 
+  cout<<" ----------- D u m p    I n t P a t c h  _  W L i n e  -(begin)------"<<endl;
+  const Standard_Integer aNbPoints = NbPnts();
+  const Standard_Integer aNbVertex = NbVertex();
+
+  switch(theMode)
+  {
+  case 0:
+    printf("Num    [X  Y  Z]     [U1  V1]   [U2  V2]\n");
+    for(Standard_Integer i=1; i<=aNbPoints; i++)
+    {
+      Standard_Real u1,v1,u2,v2;
+      Point(i).Parameters(u1,v1,u2,v2);
+      printf("%4d  [%+10.20f %+10.20f %+10.20f]  [%+10.20f %+10.20f]  [%+10.20f %+10.20f]\n",
+              i,Point(i).Value().X(),Point(i).Value().Y(),Point(i).Value().Z(),
+              u1,v1,u2,v2);
+    }
     
-    //cout<<"IntSurf_PntOn2S : "<<i<<"  Pnt ("<<curv->Value(i).Value().X()
-    //  <<","<<curv->Value(i).Value().Y()
-    //  <<","<<curv->Value(i).Value().Z()<<")"<<endl;
-    //cout<<"                :   u1("<<u1<<")   v1("<<v1<<")   u2("<<u2<<")   v2("<<v2<<")"<<endl; 
-  }
-  nbp = NbVertex();
-  for(i=1;i<=nbp;i++) { 
-    Vertex(i).Dump();
-    Standard_Real  polr = Vertex(i).ParameterOnLine();
-    Standard_Integer pol = (Standard_Integer)polr;
-    if(pol>=1 && pol<=nbp) { 
-      cout<<"----> IntSurf_PntOn2S : "<<polr<<"  Pnt ("<<Vertex(pol).Value().X()
-       <<","<<Vertex(pol).Value().Y()
-         <<","<<Vertex(pol).Value().Z()<<")"<<endl;
+    for(Standard_Integer i=1;i<=aNbVertex;i++)
+    {
+      Vertex(i).Dump();
+      Standard_Real  polr = Vertex(i).ParameterOnLine();
+      Standard_Integer pol = static_cast<Standard_Integer>(polr);
+
+      if(pol>=1 && pol<=aNbVertex)
+      {
+        cout<<"----> IntSurf_PntOn2S : "<<
+                      polr <<", Pnt (" << Vertex(pol).Value().X() << "," <<
+                                          Vertex(pol).Value().Y() << "," <<
+                                          Vertex(pol).Value().Z() <<")" <<endl;
+      }
+    }
+
+    break;
+  case 1:
+    for(Standard_Integer i = 1; i <= aNbPoints; i++)
+    {
+      Standard_Real u1,v1,u2,v2;
+      Point(i).Parameters(u1,v1,u2,v2);
+      printf("point p%d %+10.20f %+10.20f %+10.20f\n",
+              i,Point(i).Value().X(),Point(i).Value().Y(),Point(i).Value().Z());
+    }
+
+    break;
+  case 2:
+    for(Standard_Integer i = 1; i <= aNbPoints; i++)
+    {
+      Standard_Real u1,v1,u2,v2;
+      Point(i).Parameters(u1,v1,u2,v2);
+      printf("point p%d %+10.20f %+10.20f\n", i, u1, v1);
+    }
+
+    break;
+  default:
+    for(Standard_Integer i = 1; i <= aNbPoints; i++)
+    {
+      Standard_Real u1,v1,u2,v2;
+      Point(i).Parameters(u1,v1,u2,v2);
+      printf("point p%d %+10.20f %+10.20f\n", i, u2, v2);
     }
+
+    break;
   }
-  cout<<"\n----------------------------------------------------------"<<endl;  
+  cout<<"\n--------------------------------------------------- (end) -------"<<endl;  
 }
 
index 365658a..342cda1 100644 (file)
@@ -155,7 +155,11 @@ public:
   
   Standard_EXPORT void InsertVertexBefore (const Standard_Integer theIndex, const IntPatch_Point& thePnt);
   
-  Standard_EXPORT void Dump() const;
+  //! if (theMode == 0) then prints the information about WLine
+  //! if (theMode == 1) then prints the list of 3d-points
+  //! if (theMode == 2) then prints the list of 2d-points on the 1st surface
+  //! Otherwise,             prints list of 2d-points on the 2nd surface
+  Standard_EXPORT void Dump(const Standard_Integer theMode) const;
 
 
 
index 3132985..10bde06 100644 (file)
@@ -682,7 +682,7 @@ void IntTools_FaceFace::Perform(const TopoDS_Face& aF1,
   {
     const Standard_Real UVMaxStep = 0.001;
     const Standard_Real Deflection = (hasCone) ? 0.085 : 0.1;
-  myIntersector.SetTolerances(TolArc, TolTang, UVMaxStep, Deflection); 
+    myIntersector.SetTolerances(TolArc, TolTang, UVMaxStep, Deflection); 
   }
   
   if((myHS1->IsUClosed() && !myHS1->IsUPeriodic()) || 
@@ -1593,7 +1593,7 @@ Standard_Real IntTools_FaceFace::ComputeTolerance()
       Handle(IntPatch_WLine)::DownCast(L);
 
 #ifdef OCCT_DEBUG
-    //WL->Dump();
+    //WL->Dump(0);
 #endif
 
     //
index ea14adf..f21242d 100644 (file)
@@ -1,6 +1,4 @@
 puts "TODO OCC26417 ALL: Faulty shapes in variables faulty_1"
-puts "TODO OCC26417 ALL: Error : Result shape is WRONG because it must contains 13 wires"
-puts "TODO OCC26417 ALL: Error : Result shape is WRONG because it must contains 80 shapes"
 
 puts "================"
 puts "OCC25319"
@@ -17,14 +15,14 @@ bcommon result b1 b2
 
 set square 1690.81
 
-set nb_v_good 20
-set nb_e_good 31
+set nb_v_good 19
+set nb_e_good 30
 set nb_w_good 13
 set nb_f_good 13
 set nb_sh_good 1
 set nb_sol_good 1
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 80
+set nb_shape_good 78
 
 set 2dviewer 1
index 4f39750..6aa7ecd 100644 (file)
@@ -1,6 +1,4 @@
 puts "TODO OCC26417 ALL: Faulty shapes in variables faulty_1"
-puts "TODO OCC26417 ALL: Error : Result shape is WRONG because it must contains 13 wires"
-puts "TODO OCC26417 ALL: Error : Result shape is WRONG because it must contains 80 shapes"
 
 puts "================"
 puts "OCC25319"
@@ -20,14 +18,14 @@ bcommon result b1 b2
 
 set square 1690.81
 
-set nb_v_good 20
-set nb_e_good 31
+set nb_v_good 19
+set nb_e_good 30
 set nb_w_good 13
 set nb_f_good 13
 set nb_sh_good 1
 set nb_sol_good 1
 set nb_compsol_good 0
 set nb_compound_good 1
-set nb_shape_good 80
+set nb_shape_good 78
 
 set 2dviewer 1
diff --git a/tests/bugs/modalg_6/bug26621 b/tests/bugs/modalg_6/bug26621
new file mode 100644 (file)
index 0000000..ad02fd8
--- /dev/null
@@ -0,0 +1,31 @@
+puts "========"
+puts "OCC26621"
+puts "========"
+puts ""
+###########################################
+# Boolean Cut does not work on two solids
+###########################################
+
+set nb_v_good 186
+set nb_e_good 360
+set nb_w_good 174
+set nb_f_good 174
+set nb_sh_good 1
+set nb_sol_good 1
+set nb_compsol_good 0
+set nb_compound_good 1
+set nb_shape_good 897
+
+smallview
+
+restore [locate_data_file OCC26621-body.brep] body
+restore [locate_data_file OCC26621-cutter.brep] cutter
+
+bopargcheck body
+bopargcheck cutter
+bcut result body cutter
+donly result
+fit
+nbshapes result
+
+set only_screen_axo 1