]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
[bos #32155] EDF 25230 - face non planar jfa/32155_MakeFaceWires_Fix master 17/head
authorjfa <jfa@opencascade.com>
Mon, 25 Mar 2024 13:44:54 +0000 (13:44 +0000)
committerjfa <jfa@opencascade.com>
Wed, 2 Oct 2024 09:45:15 +0000 (10:45 +0100)
src/GEOMImpl/GEOMImpl_ShapeDriver.cxx

index 0923bd112dc33700c8bf45fee129aeb5e375ff41..b23fff4053a2b4c047fbf77e5babc6a8c746761d 100644 (file)
@@ -531,10 +531,24 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(Handle(TFunction_Logbook)& log) c
     Handle(TopTools_HSequenceOfShape) aSeqClosedWires = new TopTools_HSequenceOfShape;
     Handle(TopTools_HSequenceOfShape) aSeqOpenWires = new TopTools_HSequenceOfShape;
     for (ind = 1; ind <= aSeqWiresOut->Length(); ind++) {
-      if (aSeqWiresOut->Value(ind).Closed())
-        aSeqClosedWires->Append(aSeqWiresOut->Value(ind));
-      else
-        aSeqOpenWires->Append(aSeqWiresOut->Value(ind));
+      TopoDS_Shape aWireShape = aSeqWiresOut->Value(ind);
+      if (aWireShape.Closed()) {
+        TopoDS_Wire aWire = TopoDS::Wire(aWireShape);
+        BRepTools_WireExplorer wexp (aWire);
+        if (wexp.More()) {
+          TopoDS_Edge anEdge = wexp.Current();
+          wexp.Next();
+          if (!wexp.More()) { // one edge in the wire
+            if (BRep_Tool::Degenerated(anEdge) || !BRep_Tool::IsGeometric(anEdge)) {
+              continue;
+            }
+          }
+        }
+        aSeqClosedWires->Append(aWireShape);
+      }
+      else {
+        aSeqOpenWires->Append(aWireShape);
+      }
     }
 
     if (aSeqClosedWires->Length() < 1) {