I hope you guys can help me, here the manual way I do:
I load a new Geometry into NGSolve.
After that I navigate into “Meshing options…” select “Mash granularity=very coarse” after that under “Mesh Size/Elements per curv…radius” I switch it to the value 5.
After that “Export Mesh” to a *.STL file.
that works fine, but I need to do this automaticly.
NETGEN-6.2-dev
Developed by Joachim Schoeberl at
2010-xxxx Vienna University of Technology
2006-2010 RWTH Aachen University
1996-2006 Johannes Kepler University Linz
Including OpenCascade geometry kernel
optfile ./ng.opt does not exist - using default values
togl-version : 2
OCC module loaded
loading ngsolve library
NGSolve-6.2.1905
Using Lapack
Including sparse direct solver Pardiso
Including sparse direct solver UMFPACK
Running parallel using 6 thread(s)
importing NGSolve-6.2.1905
(should) load python file ‘Skript.py’
load OCC geometry Number of colours in STEP File: 1
Colour [1] = STEELBLUE3 : (0.380392,0.576471,0.752941)
Highest entry in topology hierarchy:
1 solid(s)
Traceback (most recent call last):
File “”, line 4, in
ImportError: cannot import name ‘meshsize’ from ‘netgen.meshing’ (C:\Program Files\ngsolve-v6.2.1905\lib\site-packages\netgen\meshing.py)
Finished executing Skript.py
Preparing visualization (deflection = 0.01) … done
i tried to study the source code, but did not found a solution.
help(MeshingParameters) does not show me a solution, so this means I am not able to set these meshing options with a python script?
Is there any other solution to use the meshing options without interacting with the GUI:
First Step
Last Step
Print Messages
it does not matter if python or not, maybe start netgen.exe with a specific command line?
I am coding a tool for ngsolve, wich is meshing much files at the same time automaticaly every file with a differnt meshing option and the users told me they need to set the meshing options listet above.
if there is no solution they have to interact with the GUI, but this is not a good way i need to do this automaticaly in the background.
does not work → ‘MESHCONST_ANALYSE’ is not defined
what I did wrong?
(should) load python file ‘\STI01\STIWA\mail\ParM\ng\projects\parm\abc\tmp.py’
Traceback (most recent call last):
File “”, line 2, in
FileNotFoundError: [WinError 3] Das System kann den angegebenen Pfad nicht finden: ‘C:\STI01\STIWA\mail\ParM\ng\projects’
Number of colours in STEP File: 1
Colour [1] = LIGHTBLUE3 : (0.654902,0.760784,0.788235)
Highest entry in topology hierarchy:
1 solid(s)
Traceback (most recent call last):
File “”, line 3, in
NameError: name ‘MESHCONST_ANALYSE’ is not defined
Finished executing \…py
Preparing visualization (deflection = 0.01) … done