From ba5361f35a924c49ee5d8a00e9840a8667c8b17c Mon Sep 17 00:00:00 2001 From: emv Date: Fri, 30 Nov 2012 12:55:58 +0400 Subject: [PATCH] 0021762: Integration of new Boolean Operation algorithm to OCCT. Modifications: 1. Test cases boolean bfuse_complex J1 P9 have been fixed (the function IsInternalFace has been modified to use the function GetFaceOff); 2. Test case chl 902 H3 has been fixed (changes in the treatment of section edges); 3. Test case boolean bsection D8 has been modified (removed TODO statement); 4. Test case boolean bsection A3 has been modified (as the shapes have been changed). --- src/BOPAlgo/BOPAlgo_BuilderSolid.cxx | 2 +- src/BOPAlgo/BOPAlgo_PaveFiller.cdl | 6 +- src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx | 221 ++++++++++--------------- src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx | 2 +- src/BOPTools/BOPTools_AlgoTools.cdl | 3 +- src/BOPTools/BOPTools_AlgoTools.cxx | 140 +++++----------- tests/boolean/bsection/A3 | 2 +- tests/boolean/bsection/D8 | 1 - 8 files changed, 142 insertions(+), 235 deletions(-) diff --git a/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx b/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx index ab9573158d..e9f4a554a9 100644 --- a/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx +++ b/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx @@ -357,7 +357,7 @@ static aSelF=(*(TopoDS_Face*)(&aLCSOff.First().Shape2())); } else if (aNbOff>1){ - BOPTools_AlgoTools::GetFaceOff(aE, aF, aLCSOff, aSelF); + BOPTools_AlgoTools::GetFaceOff(aE, aF, aLCSOff, aSelF, myContext); } // if (!aSelF.IsNull() && AddedFacesMap.Add(aSelF)) { diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller.cdl b/src/BOPAlgo/BOPAlgo_PaveFiller.cdl index 51ad584bfd..a21b312a1e 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller.cdl +++ b/src/BOPAlgo/BOPAlgo_PaveFiller.cdl @@ -223,7 +223,8 @@ is PostTreatFF(me:out; theMSCPB:out IndexedDataMapOfShapeCoupleOfPaveBlocks from BOPDS; - theMVI:out DataMapOfShapeInteger from BOPCol; + theMVI:out DataMapOfShapeInteger from BOPCol; + theDMExEd:out DataMapOfPaveBlockListOfPaveBlock from BOPDS; theAllocator:out BaseAllocator from BOPCol) returns Integer from Standard is protected; @@ -313,7 +314,8 @@ is --modified by NIZHNY-EMV Fri Dec 23 15:40:06 2011 --modified by NIZHNY-EMV Tue Dec 13 10:21:47 2011 - UpdateExistingPaveBlocks(me:out; + UpdateExistingPaveBlocks(me:out; + thePB : PaveBlock from BOPDS; theLPB : out ListOfPaveBlock from BOPDS; nF1 : Integer from Standard; nF2 : Integer from Standard) diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx index bf9abce85d..bde89ca4cf 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx @@ -92,16 +92,14 @@ #include #include #include - - -static void FindPaveBlocksByFirst(BOPDS_ListOfPaveBlock& aLPBC, - BOPDS_ListOfPaveBlock& aLPB); +#include static Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, const Handle(BOPInt_Context)& aCtx); -static Standard_Boolean IsAnalytic(const TopoDS_Face& aF1, - const TopoDS_Face& aF2); +static void ToleranceFF(const TopoDS_Face& aF1, + const TopoDS_Face& aF2, + Standard_Real& aTolFF); //======================================================================= //function : PerformFF @@ -123,7 +121,7 @@ static Standard_Boolean IsAnalytic(const TopoDS_Face& aF1, Standard_Boolean bJustAdd, bApp, bCompC2D1, bCompC2D2, bIsDone; Standard_Boolean bToSplit; Standard_Integer nF1, nF2, aNbCurves, aNbPoints, iX, i, iP, iC, aNbLP; - Standard_Real aApproxTol, aTolR3D, aTolR2D; + Standard_Real aApproxTol, aTolR3D, aTolR2D, aTolFF; // BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF(); aFFs.SetStartSize(iSize); @@ -164,12 +162,11 @@ static Standard_Boolean IsAnalytic(const TopoDS_Face& aF1, if (bIsDone) { aTolR3D=aFaceFace.TolReached3d(); aTolR2D=aFaceFace.TolReached2d(); - if (aTolR3D < 5.e-6){ - if (!IsAnalytic(aF1, aF2)) { - aTolR3D=5.e-6; - } else if (aTolR3D < 1.e-7) { - aTolR3D=1.e-7; - } + // + ToleranceFF(aF1, aF2, aTolFF); + // + if (aTolR3D < aTolFF){ + aTolR3D=aTolFF; } if (aTolR2D < 1.e-7){ aTolR2D=1.e-7; @@ -271,6 +268,7 @@ static Standard_Boolean IsAnalytic(const TopoDS_Face& aF1, BOPDS_ListOfPaveBlock aLPB(aAllocator); BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks aMSCPB(100, aAllocator); BOPCol_DataMapOfShapeInteger aMVI(100, aAllocator); + BOPDS_DataMapOfPaveBlockListOfPaveBlock aDMExEdges; //modified by NIZHNY-EMV Tue Sep 27 08:26:45 2011 BOPCol_DataMapOfIntegerListOfInteger aMInterfs; BOPCol_ListOfInteger aLIEF; @@ -447,7 +445,7 @@ static Standard_Boolean IsAnalytic(const TopoDS_Face& aF1, }//for (i=0; iHasEdge()) { - BOPDS_InterfFF& aFF=aFFs(aCPB.IndexInterf()); - BOPDS_VectorOfCurve& aVNC=aFF.ChangeCurves(); - BOPDS_Curve& aNC=aVNC(aCPB.Index()); - BOPDS_ListOfPaveBlock& aLPBC=aNC.ChangePaveBlocks(); - aLPBC.Clear(); + BOPDS_ListOfPaveBlock aLPBx; + aLPBx.Append(aPB1); + aDMExEdges.Bind(aPB1, aLPBx); } else { aSI.SetShapeType(aType); aSI.SetShape(aS); @@ -624,23 +630,20 @@ static Standard_Boolean IsAnalytic(const TopoDS_Face& aF1, // else if (aType==TopAbs_EDGE) { bHasPaveBlocks=aPDS->HasPaveBlocks(nSx); + const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.FindFromKey(aSx); + iX=aCPB.IndexInterf(); + iC=aCPB.Index(); + aPB1=aCPB.PaveBlock1(); + // + bOld = aPB1->HasEdge(); + if (bOld) { + BOPDS_ListOfPaveBlock aLPBx; + aDMExEdges.Bind(aPB1, aLPBx); + } + // if (!bHasPaveBlocks) { - const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.FindFromKey(aSx); - aPB1=aCPB.PaveBlock1(); - // - if (aPB1->HasEdge()) { - BOPDS_InterfFF& aFF=aFFs(aCPB.IndexInterf()); - BOPDS_VectorOfCurve& aVNC=aFF.ChangeCurves(); - BOPDS_Curve& aNC=aVNC(aCPB.Index()); - BOPDS_ListOfPaveBlock& aLPBC=aNC.ChangePaveBlocks(); - aItLPB.Initialize(aLPBC); - for (; aItLPB.More(); aItLPB.Next()) { - const Handle(BOPDS_PaveBlock)& aPBC=aItLPB.Value(); - if (aPBC==aPB1) { - aLPBC.Remove(aItLPB); - break; - } - } + if (bOld) { + aDMExEdges.ChangeFind(aPB1).Append(aPB1); } else { aSI.SetShapeType(aType); aSI.SetShape(aSx); @@ -650,17 +653,6 @@ static Standard_Boolean IsAnalytic(const TopoDS_Face& aF1, } } else { - const BOPDS_CoupleOfPaveBlocks &aCPB=theMSCPB.FindFromKey(aSx); - iX=aCPB.IndexInterf(); - iC=aCPB.Index(); - aPB1=aCPB.PaveBlock1(); - //modified by NIZHNY-EMV Tue Dec 13 15:49:29 2011 - bOld = Standard_False; - if (aPB1->HasEdge()) { - bOld = Standard_True; - } - //modified by NIZHNY-EMV Tue Dec 13 15:49:31 2011 - // BOPDS_InterfFF& aFF=aFFs(iX); BOPDS_VectorOfCurve& aVNC=aFF.ChangeCurves(); BOPDS_Curve& aNC=aVNC(iC); @@ -669,7 +661,12 @@ static Standard_Boolean IsAnalytic(const TopoDS_Face& aF1, const BOPDS_ListOfPaveBlock& aLPBx=aPDS->PaveBlocks(nSx); aNbLPBx=aLPBx.Extent(); // - if (!bOld || !aNbLPBx) { + if (bOld && !aNbLPBx) { + aDMExEdges.ChangeFind(aPB1).Append(aPB1); + continue; + } + // + if (!bOld) { aItLPB.Initialize(aLPBC); for (; aItLPB.More(); aItLPB.Next()) { const Handle(BOPDS_PaveBlock)& aPBC=aItLPB.Value(); @@ -681,11 +678,6 @@ static Standard_Boolean IsAnalytic(const TopoDS_Face& aF1, } // if (!aNbLPBx) { - //modified by NIZHNY-EMV Mon Dec 12 15:08:01 2011 - if (bOld) { - continue; - } - //modified by NIZHNY-EMV Mon Dec 12 15:08:03 2011 aE=aSx; // if (!aMVI.IsBound(aE)) { @@ -772,9 +764,11 @@ static Standard_Boolean IsAnalytic(const TopoDS_Face& aF1, aPBC->SetEdge(iE); if (bOld) { aPBC->SetOriginalEdge(aPB1->OriginalEdge()); + aDMExEdges.ChangeFind(aPB1).Append(aPBC); + } + else { + aLPBC.Append(aPBC); } - // - aLPBC.Append(aPBC); } } } @@ -1683,45 +1677,34 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, //purpose : //======================================================================= void BOPAlgo_PaveFiller::UpdateExistingPaveBlocks - (BOPDS_ListOfPaveBlock& aLPBC, + (const Handle(BOPDS_PaveBlock)& aPBf, + BOPDS_ListOfPaveBlock& aLPB, const Standard_Integer nF1, const Standard_Integer nF2) { - if (!aLPBC.Extent()) { - return; - } - // - BOPDS_IndexedMapOfPaveBlock aMPB; - Standard_Integer nE; - Handle(BOPDS_PaveBlock) aPBf; - aPBf = aLPBC.First(); - nE = aPBf->OriginalEdge(); - if (nE == -1) { - return; - } - // Handle(BOPDS_PaveBlock) aPB, aPB1, aPB2, aPB2n; Handle(BOPDS_CommonBlock) aCB; - BOPDS_ListOfPaveBlock aLPB; BOPDS_ListIteratorOfListOfPaveBlock aIt, aIt1, aIt2; - // - FindPaveBlocksByFirst(aLPBC, aLPB); - if (aLPB.Extent() == 1) { - return; - } + BOPDS_IndexedMapOfPaveBlock aMPB; // //remove micro edges from aLPB aIt.Initialize(aLPB); - for (aIt.Next(); aIt.More();) { + for (; aIt.More();) { aPB = aIt.Value(); - const TopoDS_Edge& aE = *(TopoDS_Edge*)&myDS->Shape(aPB->Edge()); - if (IsMicroEdge(aE, myContext)) { - aLPB.Remove(aIt); - continue; + if (!aPB->HasShrunkData()) { + const TopoDS_Edge& aE = *(TopoDS_Edge*)&myDS->Shape(aPB->Edge()); + if (IsMicroEdge(aE, myContext)) { + aLPB.Remove(aIt); + continue; + } } aIt.Next(); } + // + if (!aLPB.Extent()) { + return; + } //update face info myDS->UpdateFaceInfoOn(nF1); // @@ -1735,8 +1718,6 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, BOPDS_IndexedMapOfPaveBlock& aMPBOn2 = aFI2.ChangePaveBlocksOn(); BOPDS_IndexedMapOfPaveBlock& aMPBIn2 = aFI2.ChangePaveBlocksIn(); // - // - aPBf = aLPB.First(); if (aPBf->IsCommonBlock()) { const Handle(BOPDS_CommonBlock)& aCB1 = aPBf->CommonBlock(); const BOPDS_ListOfPaveBlock& aLPB2 = aCB1->PaveBlocks(); @@ -1760,7 +1741,7 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, // //create new pave blocks aIt.Initialize(aLPB); - for (aIt.Next(); aIt.More(); aIt.Next()) { + for (; aIt.More(); aIt.Next()) { aPB = aIt.Value(); // aCB = new BOPDS_CommonBlock; @@ -1785,6 +1766,7 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, } // else { + nE=aPBf->OriginalEdge(); BOPDS_ListOfPaveBlock& aLPB1 = myDS->ChangePaveBlocks(nE); aIt1.Initialize(aLPB1); for (; aIt1.More(); aIt1.Next()) { @@ -1796,7 +1778,7 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, } // aIt.Initialize(aLPB); - for (aIt.Next(); aIt.More(); aIt.Next()) { + for (; aIt.More(); aIt.Next()) { aPB = aIt.Value(); // Standard_Integer nF = (aMPBOn1.Contains(aPBf) || @@ -1923,35 +1905,6 @@ void BOPAlgo_PaveFiller::RemoveUsedVertices(BOPDS_Curve& aNC, aMVI.Bind(aV2, nV2); } - -//======================================================================= -//function : FindPaveBlocksByFirst -//purpose : -//======================================================================= -void FindPaveBlocksByFirst(BOPDS_ListOfPaveBlock& aLPBC, - BOPDS_ListOfPaveBlock& aLPB) -{ - Standard_Integer nE; - BOPDS_ListIteratorOfListOfPaveBlock aIt; - // - const Handle(BOPDS_PaveBlock)& aPB1 = aLPBC.First(); - nE = aPB1->OriginalEdge(); - aLPB.Append(aPB1); - // - aLPBC.RemoveFirst(); - // - aIt.Initialize(aLPBC); - for (;aIt.More();) { - const Handle(BOPDS_PaveBlock)& aPB = aIt.Value(); - if (aPB->OriginalEdge() == nE) { - aLPB.Append(aPB); - aLPBC.Remove(aIt); - continue; - } - aIt.Next(); - } -} - //======================================================================= //function : IsMicroEdge //purpose : Checks if it is possible to compute shrunk range for the edge . @@ -1991,27 +1944,37 @@ Standard_Boolean IsMicroEdge(const TopoDS_Edge& aE, } //======================================================================= -//function : IsAnalytic -//purpose : Checks if the faces have analytical surfaces +//function : ToleranceFF +//purpose : Computes the TolFF according to the tolerance value and +// types of the faces. //======================================================================= - Standard_Boolean IsAnalytic(const TopoDS_Face& aF1, - const TopoDS_Face& aF2) + void ToleranceFF(const TopoDS_Face& aF1, + const TopoDS_Face& aF2, + Standard_Real& aTolFF) { + Standard_Real aTol1, aTol2; + Standard_Boolean isAna1, isAna2; + // + aTol1 = BRep_Tool::Tolerance(aF1); + aTol2 = BRep_Tool::Tolerance(aF2); + aTolFF = Max(aTol1, aTol2); + // BRepAdaptor_Surface BAS1(aF1); BRepAdaptor_Surface BAS2(aF2); // - Standard_Boolean isAna1 = (BAS1.GetType() == GeomAbs_Plane || - BAS1.GetType() == GeomAbs_Cylinder || - BAS1.GetType() == GeomAbs_Cone || - BAS1.GetType() == GeomAbs_Sphere || - BAS1.GetType() == GeomAbs_Torus); - Standard_Boolean isAna2 = (BAS2.GetType() == GeomAbs_Plane || - BAS2.GetType() == GeomAbs_Cylinder || - BAS2.GetType() == GeomAbs_Cone || - BAS2.GetType() == GeomAbs_Sphere || - BAS2.GetType() == GeomAbs_Torus); - - return (isAna1 && isAna2); + isAna1 = (BAS1.GetType() == GeomAbs_Plane || + BAS1.GetType() == GeomAbs_Cylinder || + BAS1.GetType() == GeomAbs_Cone || + BAS1.GetType() == GeomAbs_Sphere || + BAS1.GetType() == GeomAbs_Torus); + // + isAna2 = (BAS2.GetType() == GeomAbs_Plane || + BAS2.GetType() == GeomAbs_Cylinder || + BAS2.GetType() == GeomAbs_Cone || + BAS2.GetType() == GeomAbs_Sphere || + BAS2.GetType() == GeomAbs_Torus); + // + aTolFF = (isAna1 && isAna2) ? aTolFF : Max(aTolFF, 5.e-6); } diff --git a/src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx b/src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx index 21301950f5..66d06c8ae6 100644 --- a/src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx +++ b/src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx @@ -758,8 +758,8 @@ Standard_Integer NbWaysOut(const BOPAlgo_ListOfEdgeInfo& aLEInfo) aTV1=aTV - dt; } // - aC2D->D0 (aTV, aPV); aC2D->D0 (aTV1, aPV1); + aC2D->D0 (aTV, aPV); // if (aFlag) {//IN gp_Vec2d aV2DIn(aPV1, aPV); diff --git a/src/BOPTools/BOPTools_AlgoTools.cdl b/src/BOPTools/BOPTools_AlgoTools.cdl index ea64d3d978..2a76020820 100644 --- a/src/BOPTools/BOPTools_AlgoTools.cdl +++ b/src/BOPTools/BOPTools_AlgoTools.cdl @@ -147,7 +147,8 @@ is theEdge :Edge from TopoDS; theFace :Face from TopoDS; theLCEF :out ListOfCoupleOfShape from BOPTools; - theFaceOff :out Face from TopoDS); + theFaceOff :out Face from TopoDS; + theContext :out Context from BOPInt); ---Purpose: For the face theFace and its edge theEdge -- finds the face suitable to produce shell. -- theLCEF - set of faces to search. All faces diff --git a/src/BOPTools/BOPTools_AlgoTools.cxx b/src/BOPTools/BOPTools_AlgoTools.cxx index 7874c76ac6..19a303a85d 100644 --- a/src/BOPTools/BOPTools_AlgoTools.cxx +++ b/src/BOPTools/BOPTools_AlgoTools.cxx @@ -78,7 +78,8 @@ static static Standard_Boolean FindFacePairs (const TopoDS_Edge& theE, const BOPCol_ListOfShape& thLF, - BOPTools_ListOfCoupleOfShape& theLCFF); + BOPTools_ListOfCoupleOfShape& theLCFF, + Handle(BOPInt_Context)& theContext); static TopAbs_Orientation Orientation(const TopoDS_Edge& anE, const TopoDS_Face& aF); @@ -659,7 +660,7 @@ static BOPTools_ListOfCoupleOfShape aLCFF; BOPTools_ListIteratorOfListOfCoupleOfShape aIt; // - FindFacePairs(theEdge, theLF, aLCFF); + FindFacePairs(theEdge, theLF, aLCFF, theContext); // aIt.Initialize(aLCFF); for (; aIt.More(); aIt.Next()) { @@ -685,32 +686,11 @@ static const TopoDS_Face& theFace2, Handle(BOPInt_Context)& theContext) { - Standard_Boolean bRet; - Standard_Real aT1, aT2, aT;//aD1, aD2, - gp_Pnt aPx, aPF, aPF1, aPF2; - gp_Pnt2d aP2D, aPF2D; - gp_Dir aDNF1, aDNF2; TopoDS_Edge aE1, aE2; - Handle(Geom_Curve)aC3D; - gp_Vec aVTgt; + TopoDS_Face aFOff; + BOPTools_ListOfCoupleOfShape theLCSOff; + BOPTools_CoupleOfShape aCS1, aCS2; // - aC3D =BRep_Tool::Curve(theEdge, aT1, aT2); - aT=BOPTools_AlgoTools2D::IntermediatePoint(aT1, aT2); - aC3D->D0(aT, aPx); - //modified by NIZHNY-EMV Wed Sep 21 13:20:31 2011 - BOPTools_AlgoTools2D::EdgeTangent(theEdge, aT, aVTgt); - gp_Dir aDTtgt(aVTgt); - aDTtgt.Reverse(); - Handle(Geom_Plane) aPL; - aPL = new Geom_Plane(aPx, aDTtgt); - //modified by NIZHNY-EMV Wed Sep 21 13:20:33 2011 - // - // 1. PF - //modified by NIZHNY-EMV Wed Oct 12 08:13:43 2011 - BOPTools_AlgoTools3D::PointNearEdge (theEdge, theFace, aT, aPF2D, aPF); - //modified by NIZHNY-EMV Wed Oct 12 08:13:47 2011 - // - // 2. E1, E2 BOPTools_AlgoTools::GetEdgeOnFace(theEdge, theFace1, aE1); if (aE1.Orientation()==TopAbs_INTERNAL) { aE2=aE1; @@ -726,68 +706,27 @@ static BOPTools_AlgoTools::GetEdgeOnFace(theEdge, theFace2, aE2); } // - // 3 - bRet=Standard_False; + aCS1.SetShape1(theEdge); + aCS1.SetShape2(theFace); + theLCSOff.Append(aCS1); // - //modified by NIZHNY-EMV Wed May 25 10:01:51 2011 - if (!GetProjectPoint(theFace, aPF, theFace1, aPF1, aDNF1, theContext)) { - BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge (aE1, theFace1, aT, aPF1, aDNF1); - } - if (!GetProjectPoint(theFace, aPF1, theFace2, aPF2, aDNF2, theContext)) { - BOPTools_AlgoTools3D::GetApproxNormalToFaceOnEdge (aE2, theFace2, aT, aPF2, aDNF2); - } - //modified by NIZHNY-EMV Wed May 25 10:01:53 2011 - //modified by NIZHNY-EMV Wed Sep 21 13:25:27 2011 - //get projects of the points aPF, aPF1, aPF2 on the plane aPL - //927/R7 - gp_Pnt aPFx, aPF1x, aPF2x; - CorrectPoint(aPF, aPL, aPFx); - CorrectPoint(aPF1, aPL, aPF1x); - CorrectPoint(aPF2, aPL, aPF2x); + aCS2.SetShape1(aE2); + aCS2.SetShape2(theFace2); + theLCSOff.Append(aCS2); // - aPF = aPFx; aPF1 = aPF1x; aPF2 = aPF2x; - //modified by NIZHNY-EMV Wed Sep 21 13:25:29 2011 + GetFaceOff(aE1, theFace1, theLCSOff, aFOff, theContext); // - { - Standard_Real aA12, aA1x, aTwoPI; - // - aTwoPI=2.*M_PI; - gp_Vec aVBF (aPx, aPF ); - gp_Vec aVBF1(aPx, aPF1); - gp_Vec aVBF2(aPx, aPF2); - // - gp_Dir aDTF1; - gp_Dir aDBF (aVBF); - gp_Dir aDBF1(aVBF1); - gp_Dir aDBF2(aVBF2); - // - aDTF1=aDNF1^aDBF1; - //aA12=aDBF1.AngleWithRef(aDBF2, aDTF1); - aA12=AngleWithRef(aDBF1, aDBF2, aDTF1); - if (aA12<0.) { - aA12=aA12+aTwoPI; - } - //aA1x=aDBF1.AngleWithRef(aDBF , aDTF1); - aA1x=AngleWithRef(aDBF1, aDBF , aDTF1); - if (aA1x<0.) { - aA1x=aA1x+aTwoPI; - } - // - if (aA1x dR) { + return bRet; + } aProjector.LowerDistanceParameters(aU, aV); Handle(Geom_Surface) aS = BRep_Tool::Surface(aF1); BOPTools_AlgoTools3D::GetNormalToSurface (aS, aU, aV, aDNF1); diff --git a/tests/boolean/bsection/A3 b/tests/boolean/bsection/A3 index f64146901d..42d4125838 100644 --- a/tests/boolean/bsection/A3 +++ b/tests/boolean/bsection/A3 @@ -2,4 +2,4 @@ restore [locate_data_file a2] a restore [locate_data_file b2_bsect] b bsection result a b -n2d -set length 48.4314 +set length 25.1327 diff --git a/tests/boolean/bsection/D8 b/tests/boolean/bsection/D8 index 867674a34f..da4d0e9af5 100644 --- a/tests/boolean/bsection/D8 +++ b/tests/boolean/bsection/D8 @@ -1,4 +1,3 @@ -puts "TODO OCC22911 ALL: Error : The bsection is not valid." restore [locate_data_file a49] a restore [locate_data_file b50] b bsection result a b