- Thank you received: 0
IGES import with NGS-Py possible?
6 years 2 months ago - 6 years 2 months ago #612
by ingo
IGES import with NGS-Py possible? was created 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
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.
6 years 2 months ago #613
by ddrake
Replied by ddrake on topic IGES import with NGS-Py possible?
Hi ingo,
Maybe this will help:
Best,
Dow
Maybe this will help:
Code:
import netgen.stl as stl
geo2 = stl.LoadSTLGeometry("input.stl")
m2 = geo2.GenerateMesh (maxh=0.05)
Best,
Dow
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
6 years 2 months ago #614
by christopher
Replied by christopher on topic IGES import with NGS-Py possible?
If you've compiled netgen with occ support (or used one of the installers) then you can load step files as well:
Best
Christopher
Code:
from netgen import NgOCC
geo = NgOCC.LoadOCCGeometry("geo.step")
Best
Christopher
The following user(s) said Thank You: ddrake
4 years 5 months ago #2588
by Batuev
Replied by Batuev on topic IGES import with NGS-Py possible?
I do the following and everything works well:
But when I try to do this
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.
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.
- christopher
- Offline
- Administrator
Less
More
- Thank you received: 101
4 years 5 months ago #2589
by christopher
Replied by christopher on topic IGES import with NGS-Py possible?
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