From 0c5acd2705a101a1dce45e0c274639a4885c2d72 Mon Sep 17 00:00:00 2001 From: pkv Date: Fri, 7 Sep 2012 14:11:06 +0400 Subject: [PATCH] 0023405: BOP common produces one face instead of a solid Modified class :IntTools_FaceFace - method: void IntTools_FaceFace::ComputeTolReached3d() The goal is: to give more precise definition to the value of tolerance of intersection curves in 3D for the case plane/sphere. Added test case boolean/bopcommon_complex/M7 Added test case boolean/bopcommon_simple/ZP9 for verified bug CR23374 --- src/IntTools/IntTools_FaceFace.cxx | 69 +++++++++++++++++++++++++++--- tests/boolean/bopcommon_complex/M7 | 13 ++++++ tests/boolean/bopcommon_simple/ZP9 | 11 +++++ 3 files changed, 88 insertions(+), 5 deletions(-) create mode 100755 tests/boolean/bopcommon_complex/M7 create mode 100755 tests/boolean/bopcommon_simple/ZP9 diff --git a/src/IntTools/IntTools_FaceFace.cxx b/src/IntTools/IntTools_FaceFace.cxx index ed1f19b81d..6ee4bf7174 100755 --- a/src/IntTools/IntTools_FaceFace.cxx +++ b/src/IntTools/IntTools_FaceFace.cxx @@ -315,8 +315,8 @@ static const Handle(Geom_Curve)& aC3D, const Handle(Geom2d_Curve)& aC2D1, const Handle(Geom2d_Curve)& aC2D2, - const Handle(GeomAdaptor_HSurface) myHS1, - const Handle(GeomAdaptor_HSurface) myHS2, + const Handle(GeomAdaptor_HSurface)& myHS1, + const Handle(GeomAdaptor_HSurface)& myHS2, const TopoDS_Face& aF1, const TopoDS_Face& aF2, const Handle(IntTools_Context)& aCtx); @@ -783,6 +783,7 @@ void IntTools_FaceFace::SetList(IntSurf_ListOfPntOn2S& aListOfPnts) Standard_Real aT1, aT2, dT, aD2, aD2Max, aEps, aT11, aT12; // aD2Max=0.; + aNbP=10; aNbLin=mySeqOfCurve.Length(); // for (i=1; i<=aNbLin; ++i) { @@ -804,7 +805,6 @@ void IntTools_FaceFace::SetList(IntSurf_ListOfPntOn2S& aListOfPnts) aT2=aBC->LastParameter(); // aEps=0.01*(aT2-aT1); - aNbP=10; dT=(aT2-aT1)/aNbP; for (j=1; jFirstParameter(); + aT2=aBC2D1->LastParameter(); + } + else { + aT1=aBC2D2->FirstParameter(); + aT2=aBC2D2->LastParameter(); + } + // + aEps=0.01*(aT2-aT1); + dT=(aT2-aT1)/(aNbP-1); + for (j=0; jaD2max) { + aD2max=aD2; + } + }//for (j=0; j aD2) { + myTolReached3d=sqrt(aD2max); + } + }//else if ((aType1==GeomAbs_Plane && aType2==GeomAbs_Sphere) ... + //modified by NIZNHY-PKV Thu Aug 30 13:31:12 2012t } //======================================================================= //function : MakeCurve @@ -4677,8 +4736,8 @@ Standard_Real FindMaxSquareDistance (const Standard_Real aT1, const Handle(Geom_Curve)& aC3D, const Handle(Geom2d_Curve)& aC2D1, const Handle(Geom2d_Curve)& aC2D2, - const Handle(GeomAdaptor_HSurface) myHS1, - const Handle(GeomAdaptor_HSurface) myHS2, + const Handle(GeomAdaptor_HSurface)& myHS1, + const Handle(GeomAdaptor_HSurface)& myHS2, const TopoDS_Face& myFace1, const TopoDS_Face& myFace2, const Handle(IntTools_Context)& myContext) diff --git a/tests/boolean/bopcommon_complex/M7 b/tests/boolean/bopcommon_complex/M7 new file mode 100755 index 0000000000..c59f0a1f0d --- /dev/null +++ b/tests/boolean/bopcommon_complex/M7 @@ -0,0 +1,13 @@ +puts "==================================================" +puts "BOP common produces one face instead of a solid" +puts "==================================================" + +restore [locate_data_file CR23405-Box_1.brep] bb +restore [locate_data_file CR23405-Rotation_1.brep] rr + +bop bb rr +bopcommon result + +set square 2435.25 + + diff --git a/tests/boolean/bopcommon_simple/ZP9 b/tests/boolean/bopcommon_simple/ZP9 new file mode 100755 index 0000000000..2c94093b1b --- /dev/null +++ b/tests/boolean/bopcommon_simple/ZP9 @@ -0,0 +1,11 @@ +box bb 100 100 100 +plane pl1 98.946735014, 46.491265177, 17.092869659 +plane pl2 -1.053264986, 46.491265177, 17.092869659 +psphere s1 pl1 7.5 +psphere s2 pl2 7.5 + +bop bb s1 +bopcommon result + +set square 576.293 +