1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0029711: General Fuse operation produces invalid result

The following improvements have been introduced in Boolean Operations algorithm s:
1. UBTree is replaced with EBTree in Boolean operations to be able to add/remove elements into the tree of bounding boxes.
2. Repeated (nested) intersection of sub-shapes is performed with argument vertices whose tolerances increased during the operation.
3. The algorithms of Edge/Edge and Edge/Face intersection have been improved for the cases when the intersection point is located close to the edge boundaries .
4. New procedure has been implemented to ensure forced creation of Edge/Face common blocks in cases when the edge is really close to the face.
5. Post-processing of Face/Face intersection results has been improved.
6. Extension of the planar faces for Plane/Plane intersection is avoided.
7. Builder Face now better classifies potentially internal edges relatively to new faces with filtering by bounding boxes.

Side effect changes:
1. IntTools_ShrunkRange now keeps the length of the valid range of the edge.
2. The method BOPDS_DS::UpdateEdgeTolerance() has been removed as unused (replaced by the BOPAlgo_PaveFiller::UpdateEdgeTolerance()).

Test case for the issue 0029900.
Test case for the issue 0029711.
Adjustments of the existing test cases.

Avoid using uninitialized variables.
This commit is contained in:
emv
2018-05-16 12:12:09 +03:00
committed by bugmaster
parent fb60181a3a
commit d3578357e3
48 changed files with 1885 additions and 864 deletions

View File

@@ -581,8 +581,8 @@ Standard_Integer IntTools_Context::ComputePE
{
gp_Pnt aPV = BRep_Tool::Pnt(aV);
aTolSum = aTolP1 + BRep_Tool::Tolerance(aV) + Precision::Confusion();
Standard_Real aDist1 = aP1.SquareDistance(aPV);
if (aDist1 < aDist && aDist1 < Square(aTolSum))
Standard_Real aDist1 = aP1.Distance(aPV);
if (aDist1 < aDist && aDist1 < aTolSum)
{
aDist = aDist1;
aT = BRep_Tool::Parameter(aV, aEFwd);

View File

@@ -352,11 +352,6 @@ Standard_Boolean IntTools_EdgeFace::CheckTouch
(const IntTools_CommonPrt& aCP,
Standard_Real& aTx)
{
if (myC.GetType() == GeomAbs_Line &&
myS.GetType() == GeomAbs_Plane) {
return Standard_False;
}
//
Standard_Real aTF, aTL, Tol, U1f, U1l, V1f, V1l, af, al,aDist2, aMinDist2;
Standard_Boolean theflag=Standard_False;
Standard_Integer aNbExt, iLower;

View File

@@ -425,11 +425,9 @@ void IntTools_FaceFace::Perform(const TopoDS_Face& aF1,
Standard_Real umin, umax, vmin, vmax;
//
myContext->UVBounds(myFace1, umin, umax, vmin, vmax);
CorrectPlaneBoundaries(umin, umax, vmin, vmax);
myHS1->ChangeSurface().Load(S1, umin, umax, vmin, vmax);
//
myContext->UVBounds(myFace2, umin, umax, vmin, vmax);
CorrectPlaneBoundaries(umin, umax, vmin, vmax);
myHS2->ChangeSurface().Load(S2, umin, umax, vmin, vmax);
//
Standard_Real TolAng = 1.e-8;

View File

@@ -34,6 +34,7 @@
myTS2=myT1;
myIsDone=Standard_False;
myIsSplittable=Standard_False;
myLength = 0.0;
}
//=======================================================================
//function : ~
@@ -59,6 +60,7 @@ void IntTools_ShrunkRange::SetData(const TopoDS_Edge& aE,
myT2=aT2;
myIsDone=Standard_False;
myIsSplittable=Standard_False;
myLength = 0.0;
}
//=======================================================================
//function : SetContext
@@ -178,9 +180,8 @@ void IntTools_ShrunkRange::Perform()
if (aPTolE > aPTolEMin) {
aPTolE = aPTolEMin;
}
Standard_Real anEdgeLength =
GCPnts_AbscissaPoint::Length(aBAC, myTS1, myTS2, aPTolE);
if (anEdgeLength < aDTol) {
myLength = GCPnts_AbscissaPoint::Length(aBAC, myTS1, myTS2, aPTolE);
if (myLength < aDTol) {
// micro edge
return;
}
@@ -192,11 +193,10 @@ void IntTools_ShrunkRange::Perform()
// for the edge to have possibility to be split at least once:
// 2*TolE - minimal diameter of tolerance sphere of splitting vertex
// 2*Precision::Confusion() - minimal length of the new edges
if (anEdgeLength > (2 * aTolE + 2 * aDTol)) {
if (myLength > (2 * aTolE + 2 * aDTol)) {
myIsSplittable = Standard_True;
}
//
// build bounding box for the edge on the shrunk range
BndLib_Add3dCurve::Add(aBAC, myTS1, myTS2,
aTolE + aDTol, myBndBox);
BndLib_Add3dCurve::Add(aBAC, myTS1, myTS2, aTolE + aDTol, myBndBox);
}

View File

@@ -74,6 +74,9 @@ Standard_EXPORT virtual ~IntTools_ShrunkRange();
return myIsSplittable;
}
//! Returns the length of the edge if computed.
Standard_Real Length() const { return myLength; }
protected:
TopoDS_Edge myEdge;
@@ -87,6 +90,7 @@ protected:
Handle(IntTools_Context) myCtx;
Standard_Boolean myIsDone;
Standard_Boolean myIsSplittable;
Standard_Real myLength;
private: