mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0029544: Regression vs 7.2.0: ShapeUpgrade_UnifySameDomain fails to merge linear edges
When measuring the deviation of the end of the added edge from the resulting edge take the point on the curve, not from the vertex. Test cases for the issue.
This commit is contained in:
@@ -849,7 +849,9 @@ static Standard_Boolean IsMergingPossible(const TopoDS_Edge& edge1, const TopoDS
|
||||
|
||||
if (theLineDirectionOk && t2 == GeomAbs_Line)
|
||||
{
|
||||
gp_Vec aCurV(theFirstPoint, BRep_Tool::Pnt(TopExp::LastVertex(edge2, Standard_True)));
|
||||
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;
|
||||
@@ -876,8 +878,13 @@ static Standard_Boolean GetLineEdgePoints(const TopoDS_Edge& theInpEdge, gp_Pnt&
|
||||
if (aCur->DynamicType() != STANDARD_TYPE(Geom_Line))
|
||||
return Standard_False;
|
||||
|
||||
theFirstPoint = BRep_Tool::Pnt(TopExp::FirstVertex(theInpEdge, Standard_True));
|
||||
gp_Pnt aLP = BRep_Tool::Pnt(TopExp::LastVertex(theInpEdge, Standard_True));
|
||||
if (theInpEdge.Orientation() == TopAbs_REVERSED) {
|
||||
Standard_Real tmp = f;
|
||||
f = l;
|
||||
l = tmp;
|
||||
}
|
||||
theFirstPoint = aCur->Value(f);
|
||||
gp_Pnt aLP = aCur->Value(l);
|
||||
theDirectionVec = aLP.XYZ().Subtracted(theFirstPoint.XYZ());
|
||||
theDirectionVec.Normalize();
|
||||
return Standard_True;
|
||||
|
Reference in New Issue
Block a user