Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

STEP file dimensions

More
4 years 6 months 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
4 years 6 months ago - 4 years 6 months 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: 4 years 6 months ago by christopher.
Time to create page: 0.109 seconds