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.

Precommands needed for getting better pictures/

More
4 years 2 months ago #2324 by mischl
Dear Matthias, dear all

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!
More
4 years 2 months ago #2325 by matthiash
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
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")
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
More
4 years 2 months ago #2328 by mischl
Dear Martin,
redrawing with the commands now works perfectly, however
Code:
netgen.gui.Snapshot(w=600,h=800, filename="TEST_"+str(count)+".png")
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
Code:
no frame buffer 0
as a return instead of the usual return
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).
and
Code:
python3 -m pip install Pillow Requirement already satisfied: Pillow in /usr/lib/python3/dist-packages (5.4.1)
More
4 years 2 months ago #2330 by matthiash
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
More
4 years 2 months ago #2331 by mischl
and it is solved! THANK you so much!
Time to create page: 0.167 seconds