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.

How to read step file in netgen python script

More
6 years 6 months ago #204 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
More
6 years 5 months ago #224 by cwinters
Hi,

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
More
6 years 5 months ago #225 by dgquvn
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
More
6 years 5 months ago #229 by cwinters
Hi Blueze,

I just added a function to heal the geometry after loading. So you can call
Code:
.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.

Best regards,
Christoph
More
6 years 5 months ago - 6 years 5 months ago #230 by dgquvn
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
Last edit: 6 years 5 months ago by dgquvn.
More
6 years 5 months ago #231 by cwinters
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
Time to create page: 0.139 seconds