From eefcafcac2d7ef903a5bd6d124e21bd4736beb4e Mon Sep 17 00:00:00 2001 From: jfa Date: Mon, 24 Apr 2023 16:45:03 +0100 Subject: [PATCH] Do not rebuild wire if there are no necessary changes --- src/BRepLib/BRepLib_MakeFace.cxx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/BRepLib/BRepLib_MakeFace.cxx b/src/BRepLib/BRepLib_MakeFace.cxx index 632372c33b..2e3563b5a3 100644 --- a/src/BRepLib/BRepLib_MakeFace.cxx +++ b/src/BRepLib/BRepLib_MakeFace.cxx @@ -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 {