From ff594551b85a56e56382d3172690f73b48c86cd6 Mon Sep 17 00:00:00 2001 From: dmv Date: Fri, 22 Oct 2010 07:44:35 +0000 Subject: [PATCH] PKV fix to IPAL22072 TC 5.1.5: Partition failed --- src/GEOMAlgo/GEOMAlgo_WESCorrector.cxx | 29 ++++++++------- src/NMTTools/NMTTools_DEProcessor.cxx | 50 ++++++++++++++++++++++---- 2 files changed, 60 insertions(+), 19 deletions(-) diff --git a/src/GEOMAlgo/GEOMAlgo_WESCorrector.cxx b/src/GEOMAlgo/GEOMAlgo_WESCorrector.cxx index 77ecf1947..4ee7d7a69 100755 --- a/src/GEOMAlgo/GEOMAlgo_WESCorrector.cxx +++ b/src/GEOMAlgo/GEOMAlgo_WESCorrector.cxx @@ -26,7 +26,11 @@ // #include +#include + +#include #include + #include #include #include @@ -34,6 +38,7 @@ #include #include +#include #include #include @@ -54,16 +59,15 @@ #include #include - static void MakeWire(const TopTools_ListOfShape& aLE, TopoDS_Wire& newWire); -//modified by NIZNHY-PKV Thu Jun 10 11:26:55 2010f + static Standard_Boolean IsToScale(const TopoDS_Face& aF, Standard_Real& aScale); -//modified by NIZNHY-PKV Thu Jun 10 11:27:02 2010t + //======================================================================= // function: // purpose: @@ -227,7 +231,14 @@ static } // if (bRegular) { - TopExp::MapShapesAndAncestors(aER, TopAbs_VERTEX, TopAbs_EDGE, aMVER); + //modified by NIZNHY-PKV Wed Oct 20 14:45:52 2010f + const TopoDS_Edge& aEx=*((TopoDS_Edge*)&aER); + if (!BRep_Tool::Degenerated(aEx)) { + TopExp::MapShapesAndAncestors(aER, TopAbs_VERTEX, TopAbs_EDGE, aMVER); + } + // + //TopExp::MapShapesAndAncestors(aER, TopAbs_VERTEX, TopAbs_EDGE, aMVER); + //modified by NIZNHY-PKV Wed Oct 20 14:46:48 2010t } }//for (j=1; j<=aNbC; ++j) { // @@ -274,9 +285,8 @@ static GEOMAlgo_WESScaler aWSC; // const TopoDS_Face& aF=myWES->Face(); - //modified by NIZNHY-PKV Thu Jun 10 11:27:45 2010f + // bToScale=IsToScale(aF, aScale); - //modified by NIZNHY-PKV Thu Jun 10 11:27:49 2010t // myNewWES.SetFace(aF); aCBIt.Initialize(myConnexityBlocks); @@ -293,7 +303,6 @@ static // GEOMAlgo_WireSplitter aWS; // - //modified by NIZNHY-PKV Thu Jun 10 10:40:43 2010f if(bToScale) { TopoDS_Shape aE; TopTools_ListIteratorOfListOfShape aIt; @@ -345,7 +354,6 @@ static myNewWES.AddShape (aW); } }//if(bToScale) - //modified by NIZNHY-PKV Thu Jun 10 10:40:48 2010t // else { aWS.SetFace(aF); @@ -392,11 +400,7 @@ static } } // -//modified by NIZNHY-PKV Thu Jun 10 11:14:09 2010f -#include -#include -#include //======================================================================= //function : IsToScale @@ -427,5 +431,4 @@ Standard_Boolean IsToScale(const TopoDS_Face& aF, } return bRet; } -//modified by NIZNHY-PKV Thu Jun 10 11:14:12 2010t diff --git a/src/NMTTools/NMTTools_DEProcessor.cxx b/src/NMTTools/NMTTools_DEProcessor.cxx index 336c8057e..42ffb20be 100644 --- a/src/NMTTools/NMTTools_DEProcessor.cxx +++ b/src/NMTTools/NMTTools_DEProcessor.cxx @@ -454,16 +454,54 @@ const BOPTools_SplitShapesPool& aSplitShapesPool=myFiller->SplitShapesPool(); const BOPTools_ListOfPaveBlock& aSplitEdges=aSplitShapesPool(myDS->RefEdge(nED)); - Standard_Integer nV1, nV2, aNewShapeIndex; - Standard_Real t1, t2; + Standard_Integer nV1, nV2, aNbPB, aNewShapeIndex; + Standard_Real t1, t2; TopoDS_Edge aE, aESplit; TopoDS_Vertex aV1, aV2; - + BOPTools_ListIteratorOfListOfPaveBlock aPBIt; + // const TopoDS_Edge aDE=TopoDS::Edge(myDS->Shape(nED)); const TopoDS_Face aDF=TopoDS::Face(myDS->Shape(nFD)); - - BOPTools_ListIteratorOfListOfPaveBlock aPBIt(aSplitEdges); - + // + //modified by NIZNHY-PKV Wed Oct 20 13:20:37 2010f + aNbPB=aSplitEdges.Extent(); + if (aNbPB==1) { + Standard_Real aT1, aT2, dT1, dT2, aDT; + Handle(Geom2d_Curve) aC2D; + // + BOPTools_PaveBlock& aPB=aSplitEdges.First(); + // + const BOPTools_Pave& aPave1=aPB.Pave1(); + t1=aPave1.Param(); + const BOPTools_Pave& aPave2=aPB.Pave2(); + t2=aPave2.Param(); + //// + nV1=aPave1.Index(); + aV1=*((TopoDS_Vertex*)&myDS->GetShape(nV1)); + // + aV2=TopExp::FirstVertex(aDE); + if (aV2.IsSame(aV1)) { + aC2D=BRep_Tool::CurveOnSurface(aDE, aDF, aT1, aT2); + dT1=aT1-t1; + if (dT1<0.) { + dT1=-dT1; + } + // + dT2=aT2-t2; + if (dT2<0.) { + dT2=-dT2; + } + aDT=Precision::PConfusion(); + if(dT1Clear(); + return; + } + } + } + //modified by NIZNHY-PKV Wed Oct 20 13:20:39 2010t + // + aPBIt.Initialize(aSplitEdges); for (; aPBIt.More(); aPBIt.Next()) { BOPTools_PaveBlock& aPB=aPBIt.Value(); -- 2.39.2