Problem with IGES units...

I’m having a problem with the way OpenCascade translates my model’s parameters into units when I save the model as an IGES file.

Here’s what I’m doing:

I’m creating an aerofoil from (x,y) vertices and then converting with PointsToBspline. This edge is converted to a wire and then added to my shape. I output the model as an IGES file. The airfoil’s parameters range from x=0 to x=0.5 (My intent is that this represents a chord length of 0.5 metres).

The problem occurs when I specify the model’s units.

If I use:

IGESControl_Writer ICW ("M", 1);

Then my chord seems to be converted to MM when I re-load the IGES into CFD Meshing software (ie 0.0005 Metres).

If I use:
IGESControl_Writer ICW ("MM", 1);

Then when I load into the mesher, I see the chord as 500mm (or 0.5 Metres).

Does anyone know why this is happening?

P.S. I’ve checked the IGES files in Notepad and I do see 2HMM when I specify “MM”. When I specify “M”, I do see 1HM. So I’m even more confused!

Is there some inherant unit used for point or vertex data that I don’t know about? Or is something else happening?

Thanks, in advance, for any help you can give me,

Mike.

Roman Lygin's picture

Hi Mike,

The Open CASCADE Data Exchange processors (as well as many other algorithms) internally assume that OCC models are measured in millimeters. So, when your resulting IGES file is requested to be in MM, it keeps geometric values unchanged. That's why you get 0.5 in the 2nd case.
When you specify M as output, then it obviously scales down and gets 0.0005 (M) in the file.

So you need to check if CFD meshing software correctly reads IGES files or how you interpret units in it. Or, you need to create your original OCC model 1000 times bigger.

Hope this helps.
Roman

dieselweasel's picture

Yes, that helps a lot. Thanks very much, Roman! I can get it fixed now!

Cheers,

Mike.

PG's picture

Hi Roman,
My system has interface to use MM or INCH. But for the
cases , the values which are fed to OCC API's are same
irrespective of the desired unit system. So 10 mm or 10 inch
is same to OCC.
How to set it globally to handle different unit system so
that automatically when exporting also it works ( by just
setting the appropriate flag.
Can the UnitsAPI be used solve such a problem ?
It is impossible to set the scale factor as suggested for
all the entities .
pl. give ur views.

regards

- PG

Roman Lygin's picture

Hi PG,

Most OCC algorithms are units-agnostic, they do not make assumptions on the units the model can be in. However, for comparisons with zero the absolute values from the Precision package are used (e.g. Preicision::Confusion()).

So, if you are concerned about exporting you could set required destination units, using Interface_Static class:
- "write.iges.unit" for IGES
- "write.step.unit" for STEP
See Data Exchange User's Guide on syntax.

In addition, you could use "xstep.cascade.unit" which defines how Data Exchange processors should interpret Open CASCADE 3D coordinates before converting to/from neutral format. All three by default are "MM".

Hope this helps.
Roman

---
opencascade.blogspot.com - blog on Open CASCADE

suman's picture

Hi Roman...
I have a problem in converting an STL File to IGES file.I deserve that you can solve my problem...

The Problem is when I have developed an application to convert an STL file to IGES by using openCascade API and VC++6.0.

It's working in the machine in which opencascade softwares has been instaled.But I want to run the application with out installing OpenCascade softwares.Is it Possible?If it's possible..Please help me out in this regard..

I'm in a hurry to deliver this product...
I hope You can help me...If it's not possible,give me some guidelines to use the application with less installation burden by the customer...

Thanks in Advance
Suman