View Issue Details

IDProjectCategoryView StatusLast Update
0021994CommunityOCCT:Data Exchangepublic2012-01-11 15:58
ReporterabvAssigned Togka 
Status assignedResolutionopen 
Summary0021994: Incorrect reading of inconsistent IGES header
DescriptionThis problem has been reported by OCCT user Cauchy Ding on Forum thread 19132:


I find a strange iges file. I read it in other three CAD/CAE softwares, and
find the model sizes are all about 270. But I read it in my software using OCC,
the model size is about 6000. Yes, most of these problems are caused by
different unit reading. But I find it's not in this case. I debug it and find a
potential (maybe it's not a bug, :)) bug in void iges_param
, this function is in analiges.c file.

void iges_param(Pstat,ligne,c_separ,c_fin,lonlin)
int *Pstat; char c_separ,c_fin, *ligne; int lonlin;
int i,i0,j; char param[80]; char unpar;
if (*Pstat == 0) reste = 0;
if (*Pstat != 2) numcar = 0;
if (*Pstat < 3) nbcarH = 0;
else {
numcar = nbcarH;
if (numcar > lonlin) {
nbcarH -= lonlin; /* ??? enregistrer ... ??? */
} else {
nbcarH = 0;
/*******Start: I add a line here to try to fix the potential bug*************/
reste = 0;
/*******End: I add a line here to try to fix the potential bug*************/

I attached a iges head file, you can copy these contents and replace head
contents in your iges file. And compare it with your raw iges file. You will
find the model will have two different sizes.

PS: The system ID segment is a long string and crosses two lines. The occ
treats this head file as scale = 2.0, unit=null.


The reason of the problem is inconsistent IGES header: missing comma after
string identifying preprocessor (between "INC." and "6H980406"). The comma is
declared as field separator in the first field of the global section (and it is
also default separator), and it must be used to separate fields. Lack of comma
causes fields to be incorrectly enumerated, and the result is incorrect unit
interpreted by OCCT IGES translator.

It might be reasonable to improve OCCT IGES reader to be able to treat such
cases more correctly (probably the correction suggested above will do the job).

Attached is sample file with incorrect header (file bearing.iges from OCCT
distribution with header replaced by the one submitted in the problem report)
TagsNo tags attached.
Test case number

Attached Files

  • bearingx.iges (1,300,684 bytes)


2010-09-03 09:10


bearingx.iges (1,300,684 bytes)


2012-01-11 15:58

manager   ~0019084

Could you check the problem.

Issue History

Date Modified Username Field Change
2011-08-02 11:12 bugmaster Category OCCT:DTE => OCCT:Data Exchange
2011-12-15 16:12 abv Project Open CASCADE => Community
2012-01-11 15:58 szy Note Added: 0019084
2012-01-11 15:58 szy Assigned To bugmaster => gka
2012-01-11 15:58 szy Status new => assigned