I just wonder if there is a way of using OCC in the netgen python script. The tutorial only shows using CSG geometry and others. I want to be able to read step file into python script and run the netgen using python file. Thanks a lot for the assistance!
there is a module NgOCC which has a function LoadOCCGeometry. Here is a small example
from netgen.NgOCC import *
geo = LoadOCCGeometry('screw.step')
mesh = geo.GenerateMesh()
from ngsolve import *
Make sure to use the newest release (v6.2.1710).
This module isn’t frequently used from your side. If you have any problems, feel free to ask.
Thank you very much for the assistance. Do you know to how to heal geometry in python script after importing step file?
I just added a function to heal the geometry after loading. So you can call
.Heal() on a OCCGeometry. It is in our git repo now and a merge request is submitted.
Are you using and self compiled or an installer version of Netgen?
After the merge request is accepted, the change is pushed to github should be in the nightly installer the day after.
Thank you very much for this updated information. I build the netgen using cmake according to
Will I need to git update and then reinstall according to the link above, once the netgen github merge request is completed? Thanks a lot!
exactly, you just have to follow the “Keep it up to date” section in the link you wrote.
You are welcome. If you need another functionality from the gui in the python interface, just ask and we will try to add it.
Thank you very much for the information.
Just exploring your viewer.
Really like it.
Even found 1651-how-could-i-import-step-file-as-topods-shape#4462 to convert the occgeometry into a shape so I can view the imported step file prior to creating a mesh.
What I also like is that in the viewer I can mouse-click on a face or edge and the face/edge ID is shown.
Would it be possible to get this information available in my python code?
And would it also be possible for the VERTICES?
And if so, I would also like to have (x,y,z) coordinates related to the face/edge/vertex ID?