mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0024789: BOPAlgo_Builder produces invalid result on planar, conical and spherical surfaces
BOPAlgo_PaveFiller::MakeBlocks() - Improve Face/Face post treatment procedure by: * Adding more existing edge for intersection with section edges to resolve all possible intersections. * Using tree for edges selection. * Avoiding intersection of the existing edges among themselves. IntPatch_ImpImpIntersection::CyCyNoGeometric - add more points to wline to make it more smooth.
This commit is contained in:
@@ -125,7 +125,8 @@ myVMinParameter(0.),
|
||||
myVMaxParameter(0.),
|
||||
myBeanTolerance(0.),
|
||||
myFaceTolerance(0.),
|
||||
myIsDone(Standard_False)
|
||||
myIsDone(Standard_False),
|
||||
myMinSqDistance(RealLast())
|
||||
{
|
||||
myCriteria = Precision::Confusion();
|
||||
myCurveResolution = Precision::PConfusion();
|
||||
@@ -146,7 +147,8 @@ IntTools_BeanFaceIntersector::IntTools_BeanFaceIntersector(const TopoDS_Edge& th
|
||||
myVMaxParameter(0.),
|
||||
myBeanTolerance(0.),
|
||||
myFaceTolerance(0.),
|
||||
myIsDone(Standard_False)
|
||||
myIsDone(Standard_False),
|
||||
myMinSqDistance(RealLast())
|
||||
{
|
||||
Init(theEdge, theFace);
|
||||
}
|
||||
@@ -165,7 +167,8 @@ IntTools_BeanFaceIntersector::IntTools_BeanFaceIntersector(const BRepAdaptor_Cur
|
||||
myUMaxParameter(0.),
|
||||
myVMinParameter(0.),
|
||||
myVMaxParameter(0.),
|
||||
myIsDone(Standard_False)
|
||||
myIsDone(Standard_False),
|
||||
myMinSqDistance(RealLast())
|
||||
{
|
||||
Init(theCurve, theSurface, theBeanTolerance, theFaceTolerance);
|
||||
}
|
||||
@@ -192,7 +195,8 @@ IntTools_BeanFaceIntersector::IntTools_BeanFaceIntersector(const BRepAdaptor_Cur
|
||||
myVMaxParameter(theVMaxParameter),
|
||||
myBeanTolerance(theBeanTolerance),
|
||||
myFaceTolerance(theFaceTolerance),
|
||||
myIsDone(Standard_False)
|
||||
myIsDone(Standard_False),
|
||||
myMinSqDistance(RealLast())
|
||||
{
|
||||
myCurve = theCurve;
|
||||
|
||||
@@ -651,9 +655,14 @@ void IntTools_BeanFaceIntersector::ComputeAroundExactIntersection()
|
||||
ComputeRangeFromStartPoint(Standard_False, aPoint.W(), U, V);
|
||||
ComputeRangeFromStartPoint(Standard_True, aPoint.W(), U, V);
|
||||
|
||||
if(aNbRanges == myRangeManager.Length()) {
|
||||
if(aNbRanges == myRangeManager.Length())
|
||||
{
|
||||
SetEmptyResultRange(aPoint.W(), myRangeManager);
|
||||
} // end if(aNbRanges == myRangeManager.Length())
|
||||
}
|
||||
else
|
||||
{
|
||||
myMinSqDistance = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -669,6 +678,7 @@ void IntTools_BeanFaceIntersector::ComputeAroundExactIntersection()
|
||||
|
||||
ComputeRangeFromStartPoint(Standard_False, aPoint1.W(), aPoint1.U(), aPoint1.V());
|
||||
ComputeRangeFromStartPoint(Standard_True, aPoint2.W(), aPoint2.U(), aPoint2.V());
|
||||
myMinSqDistance = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -940,6 +950,9 @@ void IntTools_BeanFaceIntersector::ComputeUsingExtremum()
|
||||
|
||||
if (myExtrema.IsParallel()) {
|
||||
|
||||
if (myMinSqDistance > myExtrema.SquareDistance (1))
|
||||
myMinSqDistance = myExtrema.SquareDistance (1);
|
||||
|
||||
if(myExtrema.SquareDistance(1) < myCriteria * myCriteria) {
|
||||
Standard_Real U1, V1, U2, V2;
|
||||
Standard_Real adistance1 = Distance(anarg1, U1, V1);
|
||||
@@ -1022,6 +1035,9 @@ void IntTools_BeanFaceIntersector::ComputeUsingExtremum()
|
||||
SetEmptyResultRange(p1.Parameter(), myRangeManager);
|
||||
}
|
||||
}
|
||||
|
||||
if (myMinSqDistance > myExtrema.SquareDistance (j))
|
||||
myMinSqDistance = myExtrema.SquareDistance (j);
|
||||
} //end for
|
||||
|
||||
if(!solutionfound) {
|
||||
|
@@ -130,17 +130,14 @@ public:
|
||||
|
||||
Standard_EXPORT void Result (IntTools_SequenceOfRanges& theResults) const;
|
||||
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
|
||||
//! Returns the minimal distance found between edge and face
|
||||
Standard_Real MinimalSquareDistance() const
|
||||
{
|
||||
return myMinSqDistance;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
Standard_EXPORT void ComputeAroundExactIntersection();
|
||||
|
||||
@@ -191,6 +188,7 @@ private:
|
||||
Handle(IntTools_Context) myContext;
|
||||
IntTools_SequenceOfRanges myResults;
|
||||
Standard_Boolean myIsDone;
|
||||
Standard_Real myMinSqDistance;
|
||||
|
||||
};
|
||||
|
||||
|
@@ -71,6 +71,7 @@ static
|
||||
myIsDone=Standard_False;
|
||||
myErrorStatus=1;
|
||||
myQuickCoincidenceCheck=Standard_False;
|
||||
myMinDistance = RealLast();
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsCoincident
|
||||
@@ -535,7 +536,10 @@ void IntTools_EdgeFace::Perform()
|
||||
anIntersector.SetContext(myContext);
|
||||
//
|
||||
anIntersector.Perform();
|
||||
|
||||
|
||||
if (anIntersector.MinimalSquareDistance() < RealLast())
|
||||
myMinDistance = Sqrt (anIntersector.MinimalSquareDistance());
|
||||
|
||||
if(!anIntersector.IsDone()) {
|
||||
return;
|
||||
}
|
||||
|
@@ -177,6 +177,11 @@ public: //! @name Obtaining results
|
||||
return mySeqOfCommonPrts;
|
||||
}
|
||||
|
||||
//! Returns the minimal distance found between edge and face
|
||||
Standard_Real MinimalDistance() const
|
||||
{
|
||||
return myMinDistance;
|
||||
}
|
||||
|
||||
protected: //! @name Protected methods performing the intersection
|
||||
|
||||
@@ -210,6 +215,7 @@ protected:
|
||||
IntTools_SequenceOfCommonPrts mySeqOfCommonPrts;
|
||||
IntTools_Range myRange;
|
||||
Standard_Boolean myQuickCoincidenceCheck;
|
||||
Standard_Real myMinDistance; //!< Minimal distance found
|
||||
};
|
||||
|
||||
#endif // _IntTools_EdgeFace_HeaderFile
|
||||
|
Reference in New Issue
Block a user