mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0028017: Unexpected result of General Fuse operation
Several improvements have been made in BO code to fix the bug: - Create empty edge-edge interference if intersection is close to an end vertex. This will help to avoid creation of unnecessary edge-face intersections. - Improve PutPaveOnCurve() method to join nearly located vertices when they are put on the same section curve. - Add processing of same-domain vertices for section edges in UpdatePaveBlocks() method. - Improve the method CorrectWires() in order to not increase vertex tolerance if it will cover the major part of an edge. - Replace vertices of section edges by same-domain equivalents. - In the algorithm BOPAlgo_WireSplitter, correct angles computation and evaluation, taking into account periodicity. - Modify PostTreatFF to properly take into account the orientations of coinciding section edges. - In IntTools_Context::ComputePE, check distance from the point to vertices of the edge if the projection to the curve is failure. Tests update: - test offset\faces_type_i\C9 has been updated; now instead of returning bad shape it returns null result. Notes for porting: - Modify BopAlgo_PaveFiller so that on output each interference refers to the new vertex that will hit in the result (same-domain of the initial new vertex). - Make the method BOPDS_DS::Index() returning valid index for new shapes. // eliminate compile warning on VC14
This commit is contained in:
@@ -525,18 +525,43 @@ Standard_Integer IntTools_Context::ComputePE
|
||||
aProjector.Perform(aP1);
|
||||
|
||||
aNbProj=aProjector.NbPoints();
|
||||
if (!aNbProj) {
|
||||
return -3;
|
||||
if (aNbProj)
|
||||
{
|
||||
// point falls on the curve
|
||||
aDist = aProjector.LowerDistance();
|
||||
//
|
||||
aTolE2 = BRep_Tool::Tolerance(aE2);
|
||||
aTolSum = aTolP1 + aTolE2 + Precision::Confusion();
|
||||
//
|
||||
aT = aProjector.LowerDistanceParameter();
|
||||
if (aDist > aTolSum) {
|
||||
return -4;
|
||||
}
|
||||
}
|
||||
//
|
||||
aDist=aProjector.LowerDistance();
|
||||
//
|
||||
aTolE2=BRep_Tool::Tolerance(aE2);
|
||||
aTolSum = aTolP1 + aTolE2 + Precision::Confusion();
|
||||
//
|
||||
aT=aProjector.LowerDistanceParameter();
|
||||
if (aDist > aTolSum) {
|
||||
return -4;
|
||||
else
|
||||
{
|
||||
// point falls out of the curve, check distance to vertices
|
||||
TopoDS_Edge aEFwd = TopoDS::Edge(aE2.Oriented(TopAbs_FORWARD));
|
||||
TopoDS_Iterator itV(aEFwd);
|
||||
aDist = RealLast();
|
||||
for (; itV.More(); itV.Next())
|
||||
{
|
||||
const TopoDS_Vertex& aV = TopoDS::Vertex(itV.Value());
|
||||
if (aV.Orientation() == TopAbs_FORWARD || aV.Orientation() == TopAbs_REVERSED)
|
||||
{
|
||||
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))
|
||||
{
|
||||
aDist = aDist1;
|
||||
aT = BRep_Tool::Parameter(aV, aEFwd);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Precision::IsInfinite(aDist)) {
|
||||
return -3;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user