- Thank you received: 0
Precommands needed for getting better pictures/
5 years 7 months ago #2324
by mischl
Replied by mischl on topic Precommands needed for getting better pictures/
Dear Matthias, dear all
Tnaks alot!
However, as an example, I ahve
An additional question: After I removed the effects around my domain the Snapshot is still very very large when it comes to the ratio white space/domain. Are there any possibilities to improve this?
I just want to add, on my slides I mention Netgen/NGSolve for creating my simulations. But as written, the wide bar, the logo and cross left and right, the picture simply gets toooo wide!
Tnaks alot!
However, as an example, I ahve
Code:
ngsint.viewoptions.drawnetgenlogo=0 # this does not work
ngsint.viewoptions.drawcolorbar=0 # this does work
An additional question: After I removed the effects around my domain the Snapshot is still very very large when it comes to the ratio white space/domain. Are there any possibilities to improve this?
I just want to add, on my slides I mention Netgen/NGSolve for creating my simulations. But as written, the wide bar, the logo and cross left and right, the picture simply gets toooo wide!
5 years 7 months ago #2325
by matthiash
Replied by matthiash on topic Precommands needed for getting better pictures/
Hello,
drawnetgenlogo and drawcolorbar do both work as intended, but they only show effect when the scene is rerendered.
This is forced with "Redraw(blocking=True)". Anyway, there was an issue in this function and the redraw was not triggered properly in some cases. This is fixed on the master branch. As a workaround for older versions you can use
For taking screenshots I recommend the following Snapshot function, which is available since about a month:
The advantage is that you can select the resolution/aspect ratio but you need to have numpy and pillow (python image library) installed.
Best,
Matthias
drawnetgenlogo and drawcolorbar do both work as intended, but they only show effect when the scene is rerendered.
This is forced with "Redraw(blocking=True)". Anyway, there was an issue in this function and the redraw was not triggered properly in some cases. This is fixed on the master branch. As a workaround for older versions you can use
Code:
Redraw(blocking=True, fr=1e8)
For taking screenshots I recommend the following Snapshot function, which is available since about a month:
Code:
import netgen.gui
Redraw(blocking=True, fr=1e8) # workaround for ngsolve < v6.2.1910-142-gc33d83357
netgen.gui.Snapshot(w=1000,h=500, filename="myimage.png")
Best,
Matthias
5 years 7 months ago #2328
by mischl
Replied by mischl on topic Precommands needed for getting better pictures/
Dear Martin,
redrawing with the commands now works perfectly, however
gives me a black picture (with the right measurements)
Additionell ngsolve saves everything with the right file-name (except it's black) but I get
as a return instead of the usual return
is there a correlation?
Thanks for your time
I have the versions
and
redrawing with the commands now works perfectly, however
Code:
netgen.gui.Snapshot(w=600,h=800, filename="TEST_"+str(count)+".png")
Additionell ngsolve saves everything with the right file-name (except it's black) but I get
Code:
no frame buffer 0
is there a correlation?
Thanks for your time
I have the versions
Code:
ngsolve ist schon die neueste Version (6.2.1910-0~ubuntu19.04.1).
Code:
python3 -m pip install Pillow
Requirement already satisfied: Pillow in /usr/lib/python3/dist-packages (5.4.1)
5 years 7 months ago #2330
by matthiash
Replied by matthiash on topic Precommands needed for getting better pictures/
There seems to be an issue when calling Snapshot while the GUI is started with the netgen executable. Try running your script with 'python3 myscript.py' instead of 'netgen myscript.py'. The command 'import netgen.gui' also starts the graphical user interface.
The following user(s) said Thank You: mischl
Time to create page: 0.110 seconds