STEP file dimensions

More
5 years 1 month ago #1966 by tommaso
STEP file dimensions was created by tommaso
Hello,

I'm trying to understand how the imported STEP geometry dimensions are taken into account by Netgen.
To do so I calculate the volume of two geometry objects created one with CSGeometry and the other imported from a STEP file with OCCGeometry.
In principle they are identical. Two prisms with mm size length (where meter=1).

If I run the code:
Code:
import ngsolve as ng from netgen import csg, occ prism = csg.OrthoBrick( csg.Pnt(-2e-3,-2e-3,-1e-3), csg.Pnt(2e-3,2e-3,1e-3) ) geo1 = csg.CSGeometry() geo1.Add(prism) m1 = geo1.GenerateMesh() vol1 = ng.Integrate(1, ng.Mesh(m1)) geo2 = occ.OCCGeometry('prism.step') m2 = geo2.GenerateMesh() vol2 = ng.Integrate(1, ng.Mesh(m2))

I'm attaching the STEP file I used in the example (I had to change file extension to txt because the forum doesn't allow me to upload step files. You need to change the extension to test the code).
I verify the STEP file dimensions by looking at it's code. See for example the line:
Code:
#23 = CARTESIAN_POINT('',(-2.E-03,-2.E-03,-1.E-03));
and line:
Code:
#166 = ( LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT($,.METRE.) );

As a result:
Code:
vol1 3.200000000000064e-08
as it should be.
While:
Code:
vol2 32.00000000000064
Like if dimensions where in meter.

Why do I get such a difference? How can Ii take into account the right dimensions of a STEP file?

Thanks for your help,

Tommaso
Attachments:
More
5 years 1 month ago - 5 years 1 month ago #1970 by christopher
Replied by christopher on topic STEP file dimensions
Hi Tommaso,
OCC internally uses mm per default and we do not change that. So step models imported Netgen are always in mm.
Best
Christopher
Last edit: 5 years 1 month ago by christopher.
Time to create page: 0.113 seconds