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.

IGES import with NGS-Py possible?

More
5 years 9 months ago - 5 years 9 months ago #612 by ingo
Hi everybody,
Just a simple question, is it possible to import IGES (or STL, STEP, whatever) data into Netgen using the Python interface? I couldn't find anything in the documentation nor in the forum.
Thanks in advance for any response
Ingo
Last edit: 5 years 9 months ago by ingo.
More
5 years 9 months ago #613 by ddrake
Hi ingo,

Maybe this will help:
Code:
import netgen.stl as stl geo2 = stl.LoadSTLGeometry("input.stl") m2 = geo2.GenerateMesh (maxh=0.05)

Best,
Dow
More
5 years 9 months ago #614 by christopher
If you've compiled netgen with occ support (or used one of the installers) then you can load step files as well:
Code:
from netgen import NgOCC geo = NgOCC.LoadOCCGeometry("geo.step")

Best
Christopher
The following user(s) said Thank You: ddrake
More
4 years 6 days ago #2588 by Batuev
I do the following and everything works well:
Code:
from netgen import NgOCC geo1 = NgOCC.OCCGeometry("geo1.stp") geo2 = NgOCC.OCCGeometry("geo2.stp")

But when I try to do this
Code:
final = geo1 - geo2

Netgen gives an error "unsupported operand type for -".

Is it possible to work with STEP geometry using the Python interface?

Thanks in advance for any response.
More
4 years 5 days ago #2589 by christopher
Hi, manipulating step geometries is not possible in NGSolve. You need to use a geometric modeller for that (for example open source tool Opencascade). Then you can load the final geometry and mesh it using Netgen.
Time to create page: 0.145 seconds