1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

Do not rebuild wire if there are no necessary changes

This commit is contained in:
jfa 2023-04-24 16:45:03 +01:00
parent d1c95bea02
commit 2261172c3b

View File

@ -273,18 +273,26 @@ BRepLib_MakeFace::BRepLib_MakeFace(const TopoDS_Wire& W,
aB.MakeWire (aW);
TopoDS_Wire aWForw = W;
Standard_Boolean hasDegenerated = Standard_False;
aWForw.Orientation (TopAbs_FORWARD);
TopoDS_Iterator anIter (aWForw);
for (; anIter.More(); anIter.Next())
{
const TopoDS_Edge& aE = TopoDS::Edge (anIter.Value());
if (!BRep_Tool::Degenerated (aE))
if (BRep_Tool::Degenerated (aE))
hasDegenerated = Standard_True;
else
aB.Add (aW, aE);
}
aW.Orientation (W.Orientation()); // return to original orient
aW.Closed (W.Closed());
if (hasDegenerated) {
aW.Orientation (W.Orientation()); // return to original orient
aW.Closed (W.Closed());
}
else {
aW = W;
}
}
else
{