]> OCCT Git - occt-copy.git/commitdiff
0030544: Data Exchange - IGES import fails on specific file
authorabv <abv@opencascade.com>
Mon, 11 Mar 2019 18:28:52 +0000 (21:28 +0300)
committerabv <abv@opencascade.com>
Tue, 16 Jul 2019 10:28:08 +0000 (13:28 +0300)
Method IGESToBRep_BRepEntity::TransferEdge() is fixed to record result even if it is wire rather than edge.
This allows translation of EdgeLoop entities referring to CompositeCurve items in EdgeList entities.
Curves that fail to translate are recorded in result as Null shapes (rather than skipping them) to keep indexation of curves in EdgeList valid for remaining ones.

Method IGESToBRep_BRepEntity::TransferLoop() is improved to skip failed edges thus avoiding exception and allowing translation to complete for transferable entities.

Warning messages are corrected to be more meaningful.

Added test bugs iges bug30544

src/IGESToBRep/IGESToBRep_BRepEntity.cxx
src/IGESToBRep/IGESToBRep_IGESBoundary.cxx
src/XSMessage/XSMessage_XSTEP_us.pxx
src/XSMessage/XSTEP.fr
src/XSMessage/XSTEP.us
tests/bugs/iges/bug30544 [new file with mode: 0644]

index 37752929407be399ff5ef25cd047020107fdcb39..0206ece5fcba0344447b856bc725e32af39c6d50 100644 (file)
@@ -180,8 +180,7 @@ TopoDS_Vertex IGESToBRep_BRepEntity::TransferVertex
   if ( Sh.IsNull()) { 
     Message_Msg Msg1156("IGES_1156"); //"the Vertex number %d is a null object." FAIL!!!
     Handle(TCollection_HAsciiString) label = GetModel()->StringLabel(start);
-    Msg1156.Arg("vertex %d");
-    Msg1156.Arg(index);
+    Msg1156.Arg("vertex");
     Msg1156.Arg(label);
     SendWarning(start,Msg1156);
   }
@@ -228,7 +227,7 @@ TopoDS_Shape IGESToBRep_BRepEntity::TransferEdge
         Msg1306.Arg(inum);
        SendWarning(start,Msg1306);
        TopoDS_Edge Sh;
-       AddShapeResult(start,Sh);
+        AddShapeResult(start,Sh); // add null shape to avoid shift of indexing
       }
       else {
        TopoDS_Shape Sh = TC.TransferTopoCurve(thecurve);
@@ -286,11 +285,11 @@ TopoDS_Shape IGESToBRep_BRepEntity::TransferEdge
          }
          else if (Sh.ShapeType() == TopAbs_WIRE) {
            // pas traite 
-           Message_Msg Msg1325("IGES_1325"); //"Edge : result of TransferTopoCurve is WIRE"
+           Message_Msg Msg1325("IGES_1325"); //"Item %d of EdgeList cannot be represented by single edge (non-continuous or composite curve)."
            Msg1325.Arg(inum);
            SendWarning(start,Msg1325);
-           //AddWarning(start,"Edge : result of TransferTopoCurve is WIRE");
-         }
+            AddShapeResult(start,Sh);
+          }
        }
        else {
          Message_Msg Msg1156("IGES_1156");
@@ -298,7 +297,8 @@ TopoDS_Shape IGESToBRep_BRepEntity::TransferEdge
          Msg1156.Arg("underlying curve");
          Msg1156.Arg(label);
          SendWarning(start,Msg1156);       
-       }
+          AddShapeResult(start,Sh); // add null shape to avoid shift of indexing
+        }
       }
     }
   }
@@ -307,8 +307,7 @@ TopoDS_Shape IGESToBRep_BRepEntity::TransferEdge
   if ( Sh.IsNull()) {
     Message_Msg Msg1156("IGES_1156"); 
     Handle(TCollection_HAsciiString) label = GetModel()->StringLabel(start);
-    Msg1156.Arg("edge %d");
-    Msg1156.Arg(index);
+    Msg1156.Arg("edge");
     Msg1156.Arg(label);
     SendWarning(start,Msg1156);
   }
@@ -372,14 +371,17 @@ TopoDS_Shape IGESToBRep_BRepEntity::TransferLoop(const Handle(IGESSolid_Loop)& s
         else if (( itype == 0) && (theedge ->IsKind(STANDARD_TYPE(IGESSolid_EdgeList)))) {
          DeclareAndCast(IGESSolid_EdgeList,thelist,theedge);
          TopoDS_Shape Sh = TransferEdge(thelist,indexlist);
-         curve3d->Add (Sh);
-       }
+          if (Sh.IsNull())
+          {
+            continue; // skip non-translated edge hoping for the best; warning is already generated by TransferEdge()
+          }
+          curve3d->Add(Sh);
+        }
        else { 
          Message_Msg Msg1365("IGES_1365"); //"Improper type for the edge"
          Handle(TCollection_HAsciiString) label = GetModel()->StringLabel(start);
          Msg1365.Arg(iedge);
          SendWarning(start,Msg1365);
-         //AddWarning (start, "Improper type for the edge");   
          continue;
        }
        if (!orientation) curve3d->Reverse();
index e07ba0e88a7577685b205714ce2b531a642682bb..0afd25a328ea64e20fb8964d03bfd597d3ca3ea6 100644 (file)
@@ -125,7 +125,7 @@ IGESToBRep_IGESBoundary::IGESToBRep_IGESBoundary(const IGESToBRep_CurveAndSurfac
 
  void IGESToBRep_IGESBoundary::Check(const Standard_Boolean,const Standard_Boolean,const Standard_Boolean,const Standard_Boolean) 
 {
-  // Implemented in Advanced Data Exchange
+  // Implemented in IGESControl_IGESBoundary, subject to refactoring
 }
 
 //=======================================================================
index 2d5bef6dbea9447819c82614080baadf2cca8798..79cca7b145f9e2dec9db7996c589d36631869cb8 100644 (file)
@@ -877,7 +877,7 @@ static const char XSMessage_XSTEP_us[] =
   " Parameter data : parameter 3 or 4 (degree of basis function) is less than one or greater than maximum degree.\n"
   "!\n"
   ".IGES_1325\n"
-  " Resulting geometry not C0-continuous : TopoDS_Edge %d cannot be constructed.\n"
+  " Item %d of EdgeList cannot be represented by single edge (non-continuous or composite curve).\n"
   "!\n"
   ".IGES_1345\n"
   " Parameter data : parameter %d (parameter space curve) is incorrect.\n"
index 217482b882330d8f60ab203d2e80882dc0dfbe27..0950a372350e46bbedc2da3e5ba5e97091c7b289 100755 (executable)
@@ -873,7 +873,7 @@ L'equation polynomiale est incorrecte.
  Parameter data : le parametre 3 or 4 (degree of basis function) est inferieur a 1 ou superieur a max degree.
 !
 .IGES_1325
La geometrie resultante n'est pas continue en C0 : la construction du TopoDS_Edge %d est impossible.
Item %d of EdgeList cannot be represented by single edge (non-continuous or composite curve).
 !
 .IGES_1345
  Parameter data : le parametre %d (parameter space curve) est incorrect.
index 9dff5b33ab2c612a93bb736fc2b8ce36ec6b4051..2ed80d81050f106a99bc1a3cdace7ef5b4853e70 100755 (executable)
@@ -874,7 +874,7 @@ Exception during loading entity %s
  Parameter data : parameter 3 or 4 (degree of basis function) is less than one or greater than maximum degree.
 !
 .IGES_1325
Resulting geometry not C0-continuous : TopoDS_Edge %d cannot be constructed.
Item %d of EdgeList cannot be represented by single edge (non-continuous or composite curve).
 !
 .IGES_1345
  Parameter data : parameter %d (parameter space curve) is incorrect.
diff --git a/tests/bugs/iges/bug30544 b/tests/bugs/iges/bug30544
new file mode 100644 (file)
index 0000000..4c86589
--- /dev/null
@@ -0,0 +1,9 @@
+puts "============"
+puts "0030544: Data Exchange - IGES import  f a i l s  on specific file"
+puts "============"
+
+igesbrep [locate_data_file bug30544_deferry_normal.igs] a *
+
+checkshape a
+checkmaxtol a -ref 0.072
+checknbshapes a -face 18