From c4b907b57859a5e6f0628abdd8633429210c7603 Mon Sep 17 00:00:00 2001 From: skl Date: Thu, 16 Nov 2006 08:17:51 +0000 Subject: [PATCH] Improve new version of PartitionAlgo(PAL12951). --- src/GEOMAlgo/GEOMAlgo_Tools3D.cxx | 165 +++++++++++++++++++++++++++--- 1 file changed, 153 insertions(+), 12 deletions(-) diff --git a/src/GEOMAlgo/GEOMAlgo_Tools3D.cxx b/src/GEOMAlgo/GEOMAlgo_Tools3D.cxx index 7149d8a3a..6d97c6f61 100755 --- a/src/GEOMAlgo/GEOMAlgo_Tools3D.cxx +++ b/src/GEOMAlgo/GEOMAlgo_Tools3D.cxx @@ -65,9 +65,6 @@ #include #include #include -#include -#include -#include #include @@ -81,8 +78,13 @@ #include #include #include - +#include +#include +#include +#include +#include // + static Standard_Boolean FindFacePairs (const TopoDS_Edge& , const TopTools_ListOfShape& , @@ -212,7 +214,7 @@ static const TopoDS_Face& theFace2) { Standard_Boolean bRet; - Standard_Real aT1, aT2, aT, aDt2D, aD1, aD2, aDt2Dx; + Standard_Real aT1, aT2, aT, aDt2D, aDt2Dx;//aD1, aD2, gp_Pnt aPx, aPF, aPF1, aPF2; gp_Pnt2d aP2D, aPF2D; gp_Dir aDNF1, aDNF2; @@ -247,20 +249,64 @@ static // 3 bRet=Standard_False; // + //modified by NIZNHY-PKV Mon Nov 13 12:12:53 2006f + // BOPTools_Tools3D::GetApproxNormalToFaceOnEdge (aE1, theFace1, aT, aPF1, aDNF1); - gp_Pln aPlnF1(aPx, aDNF1); + BOPTools_Tools3D::GetApproxNormalToFaceOnEdge (aE2, theFace2, aT, aPF2, aDNF2); // - aD1=BOPTools_Tools3D::SignDistance(aPF, aPlnF1); - if (aD1<=0.) { - BOPTools_Tools3D::GetApproxNormalToFaceOnEdge (aE2, theFace2, aT, aPF2, aDNF2); - gp_Pln aPlnF2(aPx, aDNF2); + { + Standard_Real aA12, aA1x, aTwoPI; + // + aTwoPI=2.*PI; + gp_Vec aVBF (aPx, aPF ); + gp_Vec aVBF1(aPx, aPF1); + gp_Vec aVBF2(aPx, aPF2); // - aD2=BOPTools_Tools3D::SignDistance(aPF, aPlnF2); - if (aD2<=0.) { + 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