From e6b061c9ce4bbeabf4ea63d8f642862f12557e22 Mon Sep 17 00:00:00 2001 From: jfa Date: Wed, 8 Dec 2010 14:29:52 +0000 Subject: [PATCH] Mantis issue 0021092: [CEA] rc3 - non regression test : unpredictable behavior. --- src/GEOMAlgo/GEOMAlgo_Builder_3.cxx | 123 ++++++++++----------------- src/GEOMAlgo/GEOMAlgo_Tools3D.cxx | 126 +++++++++++++++------------- 2 files changed, 113 insertions(+), 136 deletions(-) diff --git a/src/GEOMAlgo/GEOMAlgo_Builder_3.cxx b/src/GEOMAlgo/GEOMAlgo_Builder_3.cxx index ea602fe60..68393f472 100755 --- a/src/GEOMAlgo/GEOMAlgo_Builder_3.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Builder_3.cxx @@ -19,11 +19,10 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// File : GEOMAlgo_Builder_3.cxx +// Created : +// Author : Peter KURNEV -// File: GEOMAlgo_Builder_3.cxx -// Created: -// Author: Peter KURNEV -// #include #include @@ -75,7 +74,7 @@ static //======================================================================= //function : FillImagesSolids -//purpose : +//purpose : //======================================================================= void GEOMAlgo_Builder::FillImagesSolids() { @@ -87,9 +86,9 @@ static } //======================================================================= //function : BuildDraftSolid -//purpose : +//purpose : //======================================================================= - void GEOMAlgo_Builder::BuildDraftSolid(const TopoDS_Shape& theSolid, +void GEOMAlgo_Builder::BuildDraftSolid (const TopoDS_Shape& theSolid, TopoDS_Shape& theDraftSolid, TopTools_ListOfShape& theLIF) { @@ -103,7 +102,7 @@ static Standard_Integer iFlag; TopAbs_Orientation aOrF, aOrSh, aOrSd; TopoDS_Iterator aIt1, aIt2; - TopTools_ListIteratorOfListOfShape aItS; + TopTools_ListIteratorOfListOfShape aItS; BRep_Builder aBB; TopoDS_Shell aShD; TopoDS_Shape aFSDx, aFx; @@ -142,7 +141,7 @@ static theLIF.Append(aFSDx); } else { - bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aFSDx, aF, aCtx); + bToReverse=GEOMAlgo_Tools3D::IsSplitToReverse(aFSDx, aF, aCtx); if (bToReverse) { aFSDx.Reverse(); } @@ -182,7 +181,7 @@ static } //======================================================================= //function : FillIn3DParts -//purpose : +//purpose : //======================================================================= void GEOMAlgo_Builder::FillIn3DParts() { @@ -193,16 +192,16 @@ static IntTools_Context& aCtx= pPF->ChangeContext(); // Standard_Boolean bIsIN, bHasImage; - Standard_Integer aNbS, aNbSolids, i, j, aNbFaces, aNbFP, aNbFPx, aNbFIN, aNbLIF;// k, - TopAbs_ShapeEnum aType; + Standard_Integer aNbS, aNbSolids, i, j, aNbFaces, aNbFP, aNbFPx, aNbFIN, aNbLIF; + TopAbs_ShapeEnum aType; TopAbs_State aState; TopTools_IndexedMapOfShape aMSolids, aMS, aMFaces, aMFIN; TopTools_MapOfShape aMFDone; TopTools_IndexedDataMapOfShapeListOfShape aMEF; - TopTools_ListIteratorOfListOfShape aItS; + TopTools_ListIteratorOfListOfShape aItS; TopoDS_Iterator aIt, aItF; BRep_Builder aBB; - TopoDS_Solid aSolidSp; + TopoDS_Solid aSolidSp; TopoDS_Face aFP; // myDraftSolids.Clear(); @@ -212,7 +211,7 @@ static const TopoDS_Shape& aS=aDS.Shape(i); // aType=aS.ShapeType(); - if (aType==TopAbs_SOLID) { + if (aType==TopAbs_SOLID) { // all solids from DS aMSolids.Add(aS); } @@ -284,6 +283,9 @@ static else { //aMS.Add(aShell); TopExp::MapShapes(aShell, TopAbs_FACE, aMS); + //modified by NIZNHY-PKV Fri Dec 03 11:18:45 2010f + TopExp::MapShapes(aShell, TopAbs_EDGE, aMS); + //modified by NIZNHY-PKV Fri Dec 03 11:18:51 2010t TopExp::MapShapesAndAncestors(aShell, TopAbs_EDGE, TopAbs_FACE, aMEF); } } @@ -304,9 +306,9 @@ static } // // among all faces from aMEFP select these that have same edges - // with the solid (i.e aMEF). These faces will be treated first + // with the solid (i.e aMEF). These faces will be treated first // to prevent the usage of 3D classifier. - // The full list of faces to process is aLFP1. + // The full list of faces to process is aLFP1. aNbEFP=aMEFP.Extent(); for (j=1; j<=aNbEFP; ++j) { const TopoDS_Shape& aE=aMEFP.FindKey(j); @@ -349,7 +351,7 @@ static if (!aMFDone.Add(aSP)) { continue; } - + // // first face to process aFP=TopoDS::Face(aSP); @@ -367,12 +369,12 @@ static } } // - // Connexity Block that spreads from aFP the Bound + // Connexity Block that spreads from aFP the Bound // or till the end of the block itself aLCBF.Clear(); GEOMAlgo_Tools3D::MakeConnexityBlock(aLFP, aMS, aLCBF); // - // fill states for the Connexity Block + // fill states for the Connexity Block aItS.Initialize(aLCBF); for (; aItS.More(); aItS.Next()) { const TopoDS_Shape& aSx=aItS.Value(); @@ -412,12 +414,12 @@ static } //======================================================================= //function : BuildSplitSolids -//purpose : +//purpose : //======================================================================= void GEOMAlgo_Builder::BuildSplitSolids() { myErrorStatus=0; - // + // const NMTDS_ShapesDataStructure& aDS=*myPaveFiller->DS(); NMTTools_PaveFiller* pPF=myPaveFiller; IntTools_Context& aCtx= pPF->ChangeContext(); @@ -432,8 +434,6 @@ static GEOMAlgo_DataMapOfShapeShapeSet aMSS; GEOMAlgo_ShapeSet aSSi; // - //modified by NIZNHY-PKV Wed Dec 6 17:08:03 2006f - // // 0. Find same domain solids for non-interferred solids aNbS=aDS.NumberOfShapesOfTheObject(); for (i=1; i<=aNbS; ++i) { @@ -452,12 +452,9 @@ static aSSi.Add(aS, TopAbs_FACE); // aMSS.Bind(aS, aSSi); - } //for (i=1; i<=aNbS; ++i) - // - //modified by NIZNHY-PKV Wed Dec 6 17:08:09 2006t + } //for (i=1; i<=aNbS; ++i) // // 1. Build solids for interferred source solids - // aSB.SetContext(aCtx); aNbS=myDraftSolids.Extent(); for (i=1; i<=aNbS; ++i) { @@ -468,7 +465,7 @@ static // // 1.1 Fill Shell Faces Set aSFS.Clear(); - + aExp.Init(aSD, TopAbs_FACE); for (; aExp.More(); aExp.Next()) { const TopoDS_Shape& aF=aExp.Current(); @@ -489,15 +486,15 @@ static aNbSFS=aSFS.Extent(); // // 1.2 - // Check whether aSFS contains a subsets of faces - // of solids that have been already built. + // Check whether aSFS contains a subsets of faces + // of solids that have been already built. // If yes, shrink aSFS by these subsets. aSSi.Clear(); aSSi.Add(aSFS); // aItSS.Initialize(aMSS); for (; aItSS.More(); aItSS.Next()) { - const TopoDS_Shape& aSR=aItSS.Key(); + const TopoDS_Shape& aSR=aItSS.Key(); const GEOMAlgo_ShapeSet& aSSR=aItSS.Value(); if (aSSi.Contains(aSSR)) { // the aSR is SD solid for aS @@ -516,6 +513,11 @@ static } const TopTools_ListOfShape& aSFS1=aSSi.GetSet(); aNbSFS=aSFS1.Extent(); + //modified by NIZNHY-PKV Wed Oct 27 09:53:15 2010f + if (!aNbSFS) { + continue; + } + //modified by NIZNHY-PKV Wed Oct 27 09:53:18 2010t // // 1.3 Build new solids aSB.SetShapes(aSFS1); @@ -528,7 +530,7 @@ static // const TopTools_ListOfShape& aLSR=aSB.Areas(); // - // 1.4 Collect resulting solids and theirs set of faces + // 1.4 Collect resulting solids and theirs set of faces aIt.Initialize(aLSR); for (; aIt.More(); aIt.Next()) { const TopoDS_Shape& aSR=aIt.Value(); @@ -550,42 +552,10 @@ static myImages.Bind(aS, aLSR); } } // for (i=1; i<=aNbS; ++i) { - //modified by NIZNHY-PKV Wed Dec 6 17:07:47 2006f - /* - // - // 2. Find same domain solids for non-interferred solids - aNbS=aDS.NumberOfShapesOfTheObject(); - for (i=1; i<=aNbS; ++i) { - const TopoDS_Shape& aS=aDS.Shape(i); - if (aS.ShapeType()!=TopAbs_SOLID) { - continue; - } - if (!aMFence.Add(aS)) { - continue; - } - if(myImages.HasImage(aS)) { - continue; - } - // - aSSi.Clear(); - aSSi.Add(aS, TopAbs_FACE); - // - aItSS.Initialize(aMSS); - for (; aItSS.More(); aItSS.Next()) { - const TopoDS_Shape& aSR=aItSS.Key(); - const GEOMAlgo_ShapeSet& aSSR=aItSS.Value(); - if (aSSi.Contains(aSSR)) { - myImages.Bind(aS, aSR); - break; - } - } - } //for (i=1; i<=aNbS; ++i) - */ - //modified by NIZNHY-PKV Wed Dec 6 17:07:55 2006t } //======================================================================= -//function :FillInternalShapes -//purpose : +//function :FillInternalShapes +//purpose : //======================================================================= void GEOMAlgo_Builder::FillInternalShapes() { @@ -610,7 +580,7 @@ static // // 1. Shapes to process // - // 1.1 Shapes from pure arguments aMSI + // 1.1 Shapes from pure arguments aMSI // 1.1.1 vertex, edge for (i=0; i<2; ++i) { jT=(Standard_Integer)aT[i]; @@ -624,7 +594,7 @@ static } } // 1.1.2 wire - { + { jT=(Standard_Integer)TopAbs_WIRE; const TopTools_ListOfShape &aLW=myShapes1[jT]; aIt.Initialize(aLW); @@ -639,7 +609,7 @@ static } } } - // 1.1.3 theirs images/sources + // 1.1.3 theirs images/sources aIt1.Initialize(aLSI); for (; aIt1.More(); aIt1.Next()) { const TopoDS_Shape& aS=aIt1.Value(); @@ -693,7 +663,7 @@ static aIt.Initialize(aLSp); for (; aIt.More(); aIt.Next()) { const TopoDS_Shape& aSp=aIt.Value(); - if (aMFence.Add(aSp)) { + if (aMFence.Add(aSp)) { TopExp::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_EDGE, aMSx); TopExp::MapShapesAndAncestors(aSp, TopAbs_VERTEX, TopAbs_FACE, aMSx); TopExp::MapShapesAndAncestors(aSp, TopAbs_EDGE , TopAbs_FACE, aMSx); @@ -707,7 +677,7 @@ static TopExp::MapShapesAndAncestors(aS, TopAbs_VERTEX, TopAbs_FACE, aMSx); TopExp::MapShapesAndAncestors(aS, TopAbs_EDGE , TopAbs_FACE, aMSx); aLSd.Append(aS); - aMSOr.Add(aS); + aMSOr.Add(aS); } } }//if (aType==TopAbs_SOLID) @@ -715,9 +685,9 @@ static // aNbSd=aLSd.Extent(); // - // 3. Some shapes of aMSI can be already tied with faces of + // 3. Some shapes of aMSI can be already tied with faces of // split solids - aItM.Initialize(aMSI); + aItM.Initialize(aMSI); for (; aItM.More(); aItM.Next()) { const TopoDS_Shape& aSI=aItM.Key(); if (aMSx.Contains(aSI)) { @@ -741,7 +711,7 @@ static for (; aIt.More(); aIt.Next()) { TopoDS_Solid aSd=TopoDS::Solid(aIt.Value()); // - aItM.Initialize(aMSI); + aItM.Initialize(aMSI); for (; aItM.More(); aItM.Next()) { TopoDS_Shape aSI=aItM.Key(); aSI.Orientation(TopAbs_INTERNAL); @@ -777,7 +747,7 @@ static } //======================================================================= //function : OwnInternalShapes -//purpose : +//purpose : //======================================================================= void OwnInternalShapes(const TopoDS_Shape& theS, TopTools_IndexedMapOfShape& theMx) @@ -795,4 +765,3 @@ static // // ErrorStatus // 30 - SolidBuilder failed - diff --git a/src/GEOMAlgo/GEOMAlgo_Tools3D.cxx b/src/GEOMAlgo/GEOMAlgo_Tools3D.cxx index b273ae5fe..865c68794 100755 --- a/src/GEOMAlgo/GEOMAlgo_Tools3D.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Tools3D.cxx @@ -19,11 +19,10 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// File : GEOMAlgo_Tools3D.cxx +// Created : +// Author : Peter KURNEV -// File: GEOMAlgo_Tools3D.cxx -// Created: -// Author: Peter KURNEV -// #include #include @@ -103,16 +102,16 @@ static const gp_Dir& ); static - void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aE, - const TopoDS_Face& aF, - Standard_Real aT, - gp_Pnt& aPF, + void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aE, + const TopoDS_Face& aF, + Standard_Real aT, + gp_Pnt& aPF, gp_Dir& aDNF, IntTools_Context& aCtx); //======================================================================= //function : IsInternalFace -//purpose : +//purpose : //======================================================================= Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace, const TopoDS_Solid& theSolid, @@ -135,7 +134,7 @@ static if (!theMEF.Contains(aE)) { continue; } - // + // const TopTools_ListOfShape& aLF=theMEF.FindFromKey(aE); aNbF=aLF.Extent(); if (!aNbF) { @@ -179,7 +178,7 @@ static } //======================================================================= //function : IsInternalFace -//purpose : +//purpose : //======================================================================= Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace, const TopoDS_Edge& theEdge, @@ -221,7 +220,7 @@ static } //======================================================================= //function : IsInternalFace -//purpose : +//purpose : //======================================================================= Standard_Boolean GEOMAlgo_Tools3D::IsInternalFace(const TopoDS_Face& theFace, const TopoDS_Edge& theEdge, @@ -246,7 +245,7 @@ static aDt2D=BOPTools_Tools3D::MinStepIn2d(); aDt2Dx=10.*aDt2D; BOPTools_Tools3D::PointNearEdge (theEdge, theFace, aT, aDt2Dx, aPF2D, aPF); - // + // // 2. E1, E2 GEOMAlgo_Tools3D::GetEdgeOnFace(theEdge, theFace1, aE1); if (aE1.Orientation()==TopAbs_INTERNAL) { @@ -287,7 +286,7 @@ static if (aA12<0.) { aA12=aA12+aTwoPI; } - + aA1x=AngleWithRef(aDBF1, aDBF , aDTF1); if (aA1x<0.) { aA1x=aA1x+aTwoPI; @@ -301,7 +300,7 @@ static } //======================================================================= //function : GetFaceOff -//purpose : +//purpose : //======================================================================= void GEOMAlgo_Tools3D::GetFaceOff(const TopoDS_Edge& theE1, const TopoDS_Face& theF1, @@ -355,7 +354,7 @@ static } //======================================================================= //function : GetEdgeOnFace -//purpose : +//purpose : //======================================================================= Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOnFace(const TopoDS_Edge& theE1, const TopoDS_Face& theF2, @@ -383,12 +382,12 @@ static } //======================================================================= //function : GetEdgeOff -//purpose : +//purpose : //======================================================================= - Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff(const TopoDS_Edge& theE1, +Standard_Boolean GEOMAlgo_Tools3D::GetEdgeOff (const TopoDS_Edge& theE1, const TopoDS_Face& theF2, TopoDS_Edge& theE2) - + { Standard_Boolean bFound; TopAbs_Orientation aOr1, aOr1C, aOr2; @@ -414,7 +413,7 @@ static } //======================================================================= // function: ComputeState -// purpose: +// purpose: //======================================================================= TopAbs_State GEOMAlgo_Tools3D::ComputeState(const TopoDS_Face& theF, const TopoDS_Solid& theRef, @@ -423,10 +422,10 @@ static IntTools_Context& theCtx) { TopAbs_State aState; - TopExp_Explorer aExp; + TopExp_Explorer aExp; TopoDS_Edge aE1; gp_Pnt2d aP2D; - gp_Pnt aP3D; + gp_Pnt aP3D; // aState=TopAbs_UNKNOWN; // @@ -456,7 +455,7 @@ static } //======================================================================= // function: ComputeStateByOnePoint -// purpose: +// purpose: //======================================================================= TopAbs_State GEOMAlgo_Tools3D::ComputeStateByOnePoint(const TopoDS_Shape& theS, const TopoDS_Solid& theRef, @@ -480,7 +479,7 @@ static } //======================================================================= // function: ComputeState -// purpose: +// purpose: //======================================================================= TopAbs_State GEOMAlgo_Tools3D::ComputeState(const TopoDS_Vertex& theV, const TopoDS_Solid& theRef, @@ -488,7 +487,7 @@ static IntTools_Context& theCtx) { TopAbs_State aState; - gp_Pnt aP3D; + gp_Pnt aP3D; // aP3D=BRep_Tool::Pnt(theV); aState=GEOMAlgo_Tools3D::ComputeState(aP3D, theRef, theTol, theCtx); @@ -496,7 +495,7 @@ static } //======================================================================= // function: ComputeState -// purpose: +// purpose: //======================================================================= TopAbs_State GEOMAlgo_Tools3D::ComputeState(const TopoDS_Edge& theE, const TopoDS_Solid& theRef, @@ -506,7 +505,7 @@ static Standard_Real aT1, aT2, aT = 0.; TopAbs_State aState; Handle(Geom_Curve) aC3D; - gp_Pnt aP3D; + gp_Pnt aP3D; // aC3D = BRep_Tool::Curve(theE, aT1, aT2); // @@ -546,7 +545,7 @@ static } //======================================================================= // function: ComputeState -// purpose: +// purpose: //======================================================================= TopAbs_State GEOMAlgo_Tools3D::ComputeState(const gp_Pnt& theP, const TopoDS_Solid& theRef, @@ -564,7 +563,7 @@ static } //======================================================================= // function: IsSplitToReverse -// purpose: +// purpose: //======================================================================= Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Shape& theSp, const TopoDS_Shape& theSr, @@ -598,7 +597,7 @@ static } //======================================================================= //function :IsSplitToReverse -//purpose : +//purpose : //======================================================================= Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Face& theFSp, const TopoDS_Face& theFSr, @@ -644,7 +643,7 @@ static aT=BOPTools_Tools2D::IntermediatePoint(aT1, aT2); BOPTools_Tools3D::GetApproxNormalToFaceOnEdge(aESp, theFSp, aT, aPFSp, aDNFSp); // - // Parts of theContext.ComputeVS(..) + // Parts of theContext.ComputeVS(..) GeomAPI_ProjectPointOnSurf& aProjector=theContext.ProjPS(theFSr); aProjector.Perform(aPFSp); if (!aProjector.IsDone()) { @@ -659,9 +658,9 @@ static } // aSr->D1(aU, aV, aPFSr, aD1U, aD1V); - gp_Dir aDD1U(aD1U); + gp_Dir aDD1U(aD1U); gp_Dir aDD1V(aD1V); - gp_Dir aDNFSr=aDD1U^aDD1V; + gp_Dir aDNFSr=aDD1U^aDD1V; if (theFSr.Orientation()==TopAbs_REVERSED){ aDNFSr.Reverse(); } @@ -673,7 +672,7 @@ static } //======================================================================= //function :IsSplitToReverse -//purpose : +//purpose : //======================================================================= Standard_Boolean GEOMAlgo_Tools3D::IsSplitToReverse(const TopoDS_Edge& theSplit, const TopoDS_Edge& theEdge, @@ -688,7 +687,7 @@ static // bRet=Standard_False; // - bIsDegenerated=(BRep_Tool::Degenerated(theSplit) || + bIsDegenerated=(BRep_Tool::Degenerated(theSplit) || BRep_Tool::Degenerated(theEdge)); if (bIsDegenerated) { return bRet; @@ -721,7 +720,7 @@ static //======================================================================= // function: Sense -// purpose: +// purpose: //======================================================================= Standard_Integer GEOMAlgo_Tools3D::Sense (const TopoDS_Face& theF1, const TopoDS_Face& theF2) @@ -767,7 +766,7 @@ static } //======================================================================= // function: CopyFace -// purpose: +// purpose: //======================================================================= void GEOMAlgo_Tools3D::CopyFace (const TopoDS_Face& theF1, TopoDS_Face& theF2) @@ -793,7 +792,7 @@ static } //======================================================================= // function: MakeContainer -// purpose: +// purpose: //======================================================================= void GEOMAlgo_Tools3D::MakeContainer(const TopAbs_ShapeEnum theType, TopoDS_Shape& theC) @@ -819,7 +818,7 @@ static TopoDS_Solid aSolid; aBB.MakeSolid(aSolid); theC=aSolid; - } + } break; // // @@ -827,7 +826,7 @@ static TopoDS_Shell aShell; aBB.MakeShell(aShell); theC=aShell; - } + } break; // case TopAbs_WIRE: { @@ -843,7 +842,7 @@ static } //======================================================================= // function: MakeConnexityBlock. -// purpose: +// purpose: //======================================================================= void GEOMAlgo_Tools3D::MakeConnexityBlock (const TopTools_ListOfShape& theLFIn, const TopTools_IndexedMapOfShape& theMEAvoid, @@ -860,7 +859,7 @@ static aNbF=theLFIn.Extent(); aIt.Initialize(theLFIn); for (; aIt.More(); aIt.Next()) { - const TopoDS_Shape& aF=aIt.Value(); + const TopoDS_Shape& aF=aIt.Value(); TopExp::MapShapesAndAncestors(aF, TopAbs_EDGE, TopAbs_FACE, aMEF); } // @@ -911,7 +910,7 @@ static } // }//while(1) { - + // aNbF=aMCB.Extent(); aItM.Initialize(aMCB); @@ -922,7 +921,7 @@ static } //======================================================================= //function : FindFacePairs -//purpose : +//purpose : //======================================================================= Standard_Boolean FindFacePairs (const TopoDS_Edge& theE, const TopTools_ListOfShape& thLF, @@ -943,7 +942,7 @@ Standard_Boolean FindFacePairs (const TopoDS_Edge& theE, // // Preface aLCEF aItLF.Initialize(thLF); - for (; aItLF.More(); aItLF.Next()) { + for (; aItLF.More(); aItLF.Next()) { const TopoDS_Face& aFL=TopoDS::Face(aItLF.Value()); // bFound=GEOMAlgo_Tools3D::GetEdgeOnFace(theE, aFL, aEL); @@ -1014,7 +1013,7 @@ Standard_Boolean FindFacePairs (const TopoDS_Edge& theE, // //======================================================================= //function : AngleWithRef -//purpose : +//purpose : //======================================================================= Standard_Real AngleWithRef(const gp_Dir& theD1, const gp_Dir& theD2, @@ -1047,17 +1046,17 @@ Standard_Real AngleWithRef(const gp_Dir& theD1, } //======================================================================= //function : GetApproxNormalToFaceOnEdge -//purpose : +//purpose : //======================================================================= -void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx, - const TopoDS_Face& aFx, - Standard_Real aT, - gp_Pnt& aPF, +void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx, + const TopoDS_Face& aFx, + Standard_Real aT, + gp_Pnt& aPF, gp_Dir& aDNF, - IntTools_Context& )//aCtx) + IntTools_Context& aCtx) { Standard_Boolean bReverse; - Standard_Real aT1, aT2, dT;//, aU, aV; + Standard_Real aT1, aT2, dT, aU, aV; gp_Dir aDTT, aDNFT, aDBT; gp_Pnt aPFT, aPFx; Handle(Geom_Curve) aC3D; @@ -1083,7 +1082,7 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx, // // Normal at aT BOPTools_Tools3D::GetNormalToFaceOnEdge (aE, aF, aT, aDNFT); - + // Tangent at aT BOPTools_Tools3D::GetTangentToEdge(aE, aT, aDTT); // @@ -1099,7 +1098,7 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx, aTS=aGAS.GetType(); if (aTS==GeomAbs_BSplineSurface || aTS==GeomAbs_BezierSurface || - aTS==GeomAbs_Plane) { + aTS==GeomAbs_Plane){ Standard_Real aTolEx, aTolFx, aTol, dUR, dVR, dR; // aTolEx=BRep_Tool::Tolerance(aEx); @@ -1112,6 +1111,19 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx, dT=dR; } } + //modified by NIZNHY-PKV Thu Dec 02 10:39:09 2010f + else if (GeomAbs_Torus || + aTS==GeomAbs_Cylinder){ + Standard_Real aTolEx, aTolFx, aTol; + // + aTolEx=BRep_Tool::Tolerance(aEx); + aTolFx=BRep_Tool::Tolerance(aFx); + aTol=2.*aTolEx+aTolFx; + if (aTol>dT) { + dT=aTol; + } + } + //modified by NIZNHY-PKV Thu Dec 02 10:39:13 2010t } //---------------------------------------------- // @@ -1123,8 +1135,6 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx, aDNF.Reverse(); } // - //modified by NIZNHY-PKV Wed Sep 22 10:52:54 2010f - /* GeomAPI_ProjectPointOnSurf& aProjector=aCtx.ProjPS(aF); // aProjector.Perform(aPFx); @@ -1136,6 +1146,4 @@ void GetApproxNormalToFaceOnEdge (const TopoDS_Edge& aEx, aDNF.Reverse(); } } - */ - //modified by NIZNHY-PKV Wed Sep 22 10:52:59 2010t } -- 2.39.2