0031812: IGES import - NURBS patches lost in the import process - 720
authorgka <gka@opencascade.com>
Thu, 1 Oct 2020 09:37:34 +0000 (12:37 +0300)
committerbugmaster <bugmaster@opencascade.com>
Tue, 6 Oct 2020 17:40:21 +0000 (20:40 +0300)
Correction for case invalid color definition to avoid considering an entity that has a number corresponding to the color field as erroneous if entity is not a color entity.

src/IGESData/IGESData_IGESReaderTool.cxx
tests/bugs/iges/bug31812 [new file with mode: 0644]

index b5769bf..a1792d5 100644 (file)
@@ -290,13 +290,15 @@ IGESData_IGESReaderTool::IGESData_IGESReaderTool
   if (v[14] <  0) {
     fieldent = GetCasted(IGESData_IGESEntity,IR->BoundEntity( (1-v[14])/2 ));
     Color = GetCasted(IGESData_ColorEntity, fieldent);
+    //an entity that is not a color entity and has a number corresponding 
+    //to the color field should not be considered erroneous
     if (Color.IsNull()) {
       // Sending of message : Incorrect Color Number 
       Message_Msg Msg34 ("XSTEP_34");
       Msg34.Arg(thecnum);
       Msg34.Arg(thectyp.Type());
       ach->SendWarning(Msg34);
-      ent->InitDirFieldEntity(13,fieldent);
+      ent->InitDirFieldEntity(13,Color);
     }
     else ent->InitColor(Color);
   }
diff --git a/tests/bugs/iges/bug31812 b/tests/bugs/iges/bug31812
new file mode 100644 (file)
index 0000000..2745503
--- /dev/null
@@ -0,0 +1,13 @@
+puts "============"
+puts "OCC31812"
+puts "============"
+puts ""
+########################################################################
+# Problem of reading IGES files
+########################################################################
+
+igesread [locate_data_file OCC31812.igs] a *
+
+checkshape a
+checknbshapes a -face 4
+checkview -display a -2d -path ${imagedir}/${test_image}.png