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()
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))[/code]
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:
#23 = CARTESIAN_POINT('',(-2.E-03,-2.E-03,-1.E-03));
#166 = ( LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT($,.METRE.) );
As a result:
as it should be.
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,