From e1b9dcd73e096168395b5d209072fc58a2e82e64 Mon Sep 17 00:00:00 2001 From: jfa Date: Wed, 18 Apr 2012 09:24:38 +0000 Subject: [PATCH] Mantis issue 0021514: EDF GEOM: Partition failure. --- src/GEOMAlgo_NEW/GEOMAlgo_WESCorrector.cxx | 15 +------ src/GEOMAlgo_NEW/GEOMAlgo_WireSplitter.cxx | 46 +++++++++++----------- 2 files changed, 24 insertions(+), 37 deletions(-) diff --git a/src/GEOMAlgo_NEW/GEOMAlgo_WESCorrector.cxx b/src/GEOMAlgo_NEW/GEOMAlgo_WESCorrector.cxx index be0077da3..83fea18f7 100644 --- a/src/GEOMAlgo_NEW/GEOMAlgo_WESCorrector.cxx +++ b/src/GEOMAlgo_NEW/GEOMAlgo_WESCorrector.cxx @@ -212,7 +212,7 @@ static TopTools_IndexedDataMapOfShapeListOfShape aMVER; // bRegular=Standard_True; - + // aNbC=aMEC.Extent(); for (j=1; j<=aNbC; ++j) { aER=aMEC(j); @@ -404,6 +404,7 @@ Standard_Boolean IsToScale(const TopoDS_Face& aF, Standard_Real& aScale) { Standard_Boolean bRet; + Standard_Real aV1, aV2, dV, aTr; GeomAbs_SurfaceType aType; BRepAdaptor_Surface aBAS; // @@ -413,8 +414,6 @@ Standard_Boolean IsToScale(const TopoDS_Face& aF, aBAS.Initialize(aF); aType=aBAS.GetType(); if (aType==GeomAbs_Cylinder) { - Standard_Real aV1, aV2, dV, dU, aTr, aC; - // aTr=1.e5; aV1=aBAS.FirstVParameter(); aV2=aBAS.LastVParameter(); @@ -425,16 +424,6 @@ Standard_Boolean IsToScale(const TopoDS_Face& aF, aScale=1./aTr; return bRet; } - //modified by NIZNHY-PKV Fri Mar 30 10:54:34 2012f - dU=M_PI; - aC=dV/dU; - aTr=25.; - if(aC>aTr){ - bRet=!bRet; - aScale=1./aC; - return bRet; - } - //modified by NIZNHY-PKV Fri Mar 30 10:54:35 2012t } return bRet; } diff --git a/src/GEOMAlgo_NEW/GEOMAlgo_WireSplitter.cxx b/src/GEOMAlgo_NEW/GEOMAlgo_WireSplitter.cxx index faa6f295a..575d5fe11 100644 --- a/src/GEOMAlgo_NEW/GEOMAlgo_WireSplitter.cxx +++ b/src/GEOMAlgo_NEW/GEOMAlgo_WireSplitter.cxx @@ -44,7 +44,6 @@ #include #include - #include #include #include @@ -52,8 +51,6 @@ #include #include - - #include #include #include @@ -446,9 +443,8 @@ static TColgp_SequenceOfPnt2d& aCoordVa, BOPTColStd_ListOfListOfShape& myShapes, BOP_IndexedDataMapOfVertexListEdgeInfo& mySmartMap) - { - Standard_Integer i,j, aNb, aNbj; + Standard_Integer i,j, aNb, aNbj, iCnt; Standard_Real aTol, anAngleIn, anAngleOut, anAngle, aMinAngle; Standard_Real aTol2D, aTol2D2; Standard_Real aTol2, aD2;//, aTolUVb, aTolVVb; @@ -561,28 +557,33 @@ static aMinAngle=100.; anIsFound=Standard_False; - - Standard_Integer aCurIndexE = 0; - + // + //modified by NIZNHY-PKV Fri Apr 13 14:48:47 2012f + iCnt=NbWaysOut (aLEInfo); + if (!iCnt) { // no way to go . (Error) + return ; + } + ++iCnt; + //modified by NIZNHY-PKV Fri Apr 13 14:48:50 2012t + // anIt.Initialize(aLEInfo); for (; anIt.More(); anIt.Next()) { BOP_EdgeInfo& anEI=anIt.Value(); const TopoDS_Edge& aE=anEI.Edge(); anIsOut=!anEI.IsIn(); anIsNotPassed=!anEI.Passed(); - + // if (anIsOut && anIsNotPassed) { - aCurIndexE++; - // - // Is there one way to go out of the vertex - // we have to use it only. - Standard_Integer iCnt; - iCnt=NbWaysOut (aLEInfo); - // - if (!iCnt) { - // no way to go . (Error) - return ; + //modified by NIZNHY-PKV Fri Apr 13 14:50:02 2012f + //iCnt=NbWaysOut (aLEInfo); + //if (!iCnt) { // no way to go . (Error) + // return ; + //} + --iCnt; + if (aE.IsSame(aEOuta)) { + continue; } + //modified by NIZNHY-PKV Fri Apr 13 14:50:06 2012t // if (iCnt==1) { // the one and only way to go out . @@ -601,7 +602,6 @@ static continue; } // - // anAngleOut=anEI.Angle(); // anAngle=ClockWiseAngle(anAngleIn, anAngleOut); @@ -617,7 +617,7 @@ static // no way to go . (Error) return; } - + // aEOutb=pEdgeInfo->Edge(); // Path (aGAS, myFace, aVb, aEOutb, *pEdgeInfo, aLS, @@ -750,11 +750,9 @@ static dA=A1-A2; if (dA <= 0.) { dA=aTwoPi+dA; - //modified by NIZNHY-PKV Thu Feb 17 08:26:39 2011f if (dA <= 1.e-14) { dA=aTwoPi; } - //modified by NIZNHY-PKV Thu Feb 17 08:26:42 2011t } //xx else if (dA <= 1.e-14) { @@ -852,7 +850,7 @@ Standard_Real Angle (const gp_Dir2d& aDir2D) return anAngle; } -// + //======================================================================= // function: NbWaysOut // purpose: