Import Step files: Map named surface to boundary condition definition


I would like to import the geometry from a step file. With the CAD system it is possible to set names for e.g. surfaces and the step ap203 exporter add the information in the advanced surface section of step spec.

How can I use / extract the information in netgen?
e.g. for meshing & mapping bc’s to the named surfaces


is this a standard for step files or something special of that exporter? If yes, can you reference us. This looks interesting, the current step reader only tracks colors of boundaries and sets different bc numbers for different colors which can be used to map boundary conditions… But it is not really nice to use.

If this is a standard, we would be interested in implementing it. Maybe you could share a trivial example with bc names set?


Looks nice.

Yeah, colering could be a nice alternative. For me an “alternative” if any other ways are impossible. Do you have an simple example / tutorial for netgen?

I’m not sure if you are knowing About the complex the step specification. … in short, the specifiaction allows a Definition of simple Geometrie in many ways. The specification tells us, a good importer / Reader should support all forms of Definition of an object … but at the real world the cad Systems only supports a few ways and each Software are cooking its own … :smiley:

Monday i will upload a few examples with my actuall cad Software (SolidWorks). I also worked with Unigraphics / Siemens NX really instensiv + programming and can tell you, its allso possible to Name surfaces and Export the names into the step file. For Catia + Pro/E I can not 100% tell you if the exporter also includes the names of surfaces.
So, let us see if we can use the names in step files of solid works in netgen. Perhaps we can deploy an Workaround. Only one Problem of my side is that I do know Nothing About netgen at the Moment :slight_smile:

I’ve just seen, that since about november last year we are using occ to get names of faces and solids for material and bc names… Are you using a current version of Netgen? If not, it would be interesting how the information is stored in the step file and we could add functionality to read it.


Two files with different simple Geometrie are added to this post. It was used the STEP-Exporter of SWX with STEP AP203 default settings.
There are named Faces (MyFace_1, MyFace_2, …) and named Edges (MyEdge_1, …) included.

Attachment: Step_1.STEP.txt

Attachment: Step_2.STEP.txt

Netgen parses the boundaries, I used this short python script to load your geometry and check the names:

from netgen.occ import *
geo = OCCGeometry("step_2.step")
from ngsolve import *
mesh = Mesh(geo.GenerateMesh())

For the first example I get

('NONE', 'NONE', 'NONE', 'MyFace_2', 'MyFace_3', 'MyFace_1')
('Aufsatz-Linear austragen1',)

The edges are currently not set (because was quite slow on that and so we disabled it). But if you need it you can build from source and comment in lines 1399-1404 in libsrc/occ/occgeom.cpp.



I will playing with it a while, but it Looks for what I searched.
Is there a change for an global build variable to enable the edge support? That would be simpler in the future to make an custom build.

we sped up the edge and face reading. Now edge and face names are set automatically on load. The changes will be tomorrow in the nightly build and in the upcoming release 2002.

Nice feature.
With print(mesh.GetBoundaries()) I can get the faces.
How to get the EDGES?

Is it also possible for the VERTICES?

mesh.GetBBoundaries() and mesh.GetBBBoundaries()
but I think they have to be named in the step file to “exist”