import iges file error with "M" unit

I import a iges file with "mm" unit, it seems ok. But error when I import the same iges file with "M" unit.

I think that maybe some parts not be converted from "MM" to "M". 

I used the below code to use "M" unit for importing.

Interface_Static::SetCVal("xstep.cascade.unit", "M");


Kirill Gavrilov's picture

I don't see anything similar in Draw Harnes or in CAD Assistant.
Which version of OCCT you are using?
How do you actually read IGES model? Any extra parameters changes?
How do you display the model in 3D Viewer?

pload ALL
param xstep.cascade.unit M
testreadiges {AAC-1937 (T26).igs} i
vinit View1
vdisplay -dispMode 1 i
VtkWorks's picture

Dear Kirill,  thanks for your replying very much.  I used the code from the Freecad for testing, please see the attachment.

I use the version 7.3.0  of OCCT.  I dumped the location and box for every shape into data_m.txt and data_mm.txt.

It seems that displaying for the "M" unit  is right.

Kirill Gavrilov's picture

It seems that I'm not familiar with XDE enough to understand document exploration code of yours.

By the way, I believe you misunderstand what HashCode function does in OCCT - it does NOT guarantee lack of collisions, even if you give it INT_MAX as an upper limit.

std::set<int> myRefShapes;
static const int HashUpper = INT_MAX;
hash = aShape.HashCode(HashUpper);
if (isRef || myRefShapes.find(hash) == myRefShapes.end()) {
VtkWorks's picture

Thank you, now  I can read the model correctly. thanks.