IGES import with NGS-Py possible?

More
6 years 2 months ago - 6 years 2 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: 6 years 2 months ago by ingo.
More
6 years 2 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
6 years 2 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 5 months 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 months 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.106 seconds