1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

0029843: Modeling Algorithms - Boolean FUSE produces incorrect result

When splitting the shell/face with internal faces/edges use the 'internal' criteria of the face to choose the way to create loops.

Side effect changes:
- When performing Boolean operation - move the objects located far from Origin to the Origin to increase the accuracy of intersections.
This commit is contained in:
emv
2019-09-20 08:56:21 +03:00
committed by apn
parent d7992a77f6
commit c08fd12706
17 changed files with 449 additions and 44 deletions

View File

@@ -1756,3 +1756,30 @@ void BOPAlgo_Tools::FillInternals(const TopTools_ListOfShape& theSolids,
}
}
}
//=======================================================================
//function : TrsfToPoint
//purpose :
//=======================================================================
Standard_Boolean BOPAlgo_Tools::TrsfToPoint (const Bnd_Box& theBox1,
const Bnd_Box& theBox2,
gp_Trsf& theTrsf,
const gp_Pnt& thePoint,
const Standard_Real theCriteria)
{
// Unify two boxes
Bnd_Box aBox = theBox1;
aBox.Add (theBox2);
gp_XYZ aBCenter = (aBox.CornerMin().XYZ() + aBox.CornerMax().XYZ()) / 2.;
Standard_Real aPBDist = (thePoint.XYZ() - aBCenter).Modulus();
if (aPBDist < theCriteria)
return Standard_False;
Standard_Real aBSize = Sqrt (aBox.SquareExtent());
if ((aBSize / aPBDist) > (1. / theCriteria))
return Standard_False;
theTrsf.SetTranslation (gp_Vec (aBox.CornerMin(), thePoint));
return Standard_True;
}