- Thank you received: 0
How to read step file in netgen python script
7 years 1 month ago #204
by dgquvn
How to read step file in netgen python script was created by dgquvn
Hello there,
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!
Best regards,
Blueze
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!
Best regards,
Blueze
7 years 3 weeks ago #224
by cwinters
Replied by cwinters on topic How to read step file in netgen python script
Hi,
there is a module NgOCC which has a function LoadOCCGeometry. Here is a small example
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.
Best regards,
Christoph
there is a module NgOCC which has a function LoadOCCGeometry. Here is a small example
Code:
from netgen.NgOCC import *
geo = LoadOCCGeometry('screw.step')
mesh = geo.GenerateMesh()
# mesh.Save('screw.vol')
from ngsolve import *
Draw(Mesh(mesh))
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.
Best regards,
Christoph
7 years 3 weeks ago #225
by dgquvn
Replied by dgquvn on topic How to read step file in netgen python script
Hello Chris,
Thank you very much for the assistance. Do you know to how to heal geometry in python script after importing step file?
Best regards,
Blueze
Thank you very much for the assistance. Do you know to how to heal geometry in python script after importing step file?
Best regards,
Blueze
7 years 2 weeks ago #229
by cwinters
Replied by cwinters on topic How to read step file in netgen python script
Hi Blueze,
I just added a function to heal the geometry after loading. So you can call
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.
Best regards,
Christoph
I just added a function to heal the geometry after loading. So you can call
Code:
.Heal()
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.
Best regards,
Christoph
7 years 2 weeks ago - 7 years 2 weeks ago #230
by dgquvn
Replied by dgquvn on topic How to read step file in netgen python script
Hello Chris,
Thank you very much for this updated information. I build the netgen using cmake according to
ngsolve.org/docu/latest/install/installlinux.html
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!
Best regards,
Blueze
Thank you very much for this updated information. I build the netgen using cmake according to
ngsolve.org/docu/latest/install/installlinux.html
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!
Best regards,
Blueze
Last edit: 7 years 2 weeks ago by dgquvn.
7 years 2 weeks ago #231
by cwinters
Replied by cwinters on topic How to read step file in netgen python script
Hi Blueze,
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.
Best regards,
Christoph
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.
Best regards,
Christoph
Time to create page: 0.110 seconds