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

0029845: UnifySameDomain does not account the accumulated angle when unifying edges

Check that the accumulated angle does not exceed the given angular tolerance while merging the linear edges.
Test case for the issue.
This commit is contained in:
emv
2018-06-07 08:29:21 +03:00
committed by bugmaster
parent 0c44027cb9
commit cf12784f94
2 changed files with 29 additions and 0 deletions

View File

@@ -849,12 +849,20 @@ static Standard_Boolean IsMergingPossible(const TopoDS_Edge& edge1, const TopoDS
if (theLineDirectionOk && t2 == GeomAbs_Line)
{
// Check that the accumulated deflection does not exceed the linear tolerance
Standard_Real aLast = (edge2.Orientation() == TopAbs_FORWARD) ?
ade2.LastParameter() : ade2.FirstParameter();
gp_Vec aCurV(theFirstPoint, ade2.Value(aLast));
Standard_Real aDD = theDirectionVec.CrossSquareMagnitude(aCurV);
if (aDD > theLinTol*theLinTol)
return Standard_False;
// Check that the accumulated angle does not exceed the angular tolerance.
// For symmetry, check the angle between vectors of:
// - first edge and resulting curve, and
// - the last edge and resulting curve.
if (theDirectionVec.Angle(aCurV) > theAngTol || Diff2.Angle(aCurV) > theAngTol)
return Standard_False;
}
return Standard_True;