Adding resulting pictures of 3D view and plot.plots on a video

Asked by Marcus Moravia

Hello, I wonder how to put together on a 'mpeg' file pictures resulting from 3D view and plot.plots just as Václav Šmilauer did in 'Periodic Triaxial Test With Clumps' (link below).

From the tutorial's script 2.6.5 (Yade Documentation) it's possible understand how make videos just for 3D primary view. I'm using Yade 1.20.0-158-2dc9944~trusty version.

##########

https://www.youtube.com/watch?v=utTDLZz0y_w

##########

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Jérôme Duriez
Solved:
Last query:
Last reply:
Revision history for this message
Klaus Thoeni (klaus.thoeni) said :
#1

Hi,

I can suggest two options:

1) use paraview: you can combine multiple views including 2D plots of time series and export them as screen-shots or movie. I guess you can find some more details on the paraview web-page [1].

2) do a bit of scripting yourself: save your screen-shots from yade (or paraview), create images for each frame of your 2D plot (i.e., using python and matplotlib), use montage from ImageMagic [2] to combine your screen-shots and images and finally use ffmpeg [3] (or avconv) to combine your frames to a movie. I guess this is what Václav did.

Please refer to the relevant documentation of the packages.

HTH
Klaus

[1] http://www.paraview.org/resources/
[2] http://www.imagemagick.org/Usage/montage/
[3] https://ffmpeg.org/ffmpeg.html

Revision history for this message
Marcus Moravia (mgmoravia) said :
#2

Hi Klaus,

First of all I need to thank you for your generosity to help me. I confess that I am still confused about how create images for each frame of 2D plot (this is the key to me!). I tried to find something to help me on matplotlib.org Web site but I got lost in the number of examples. Could you show me an example or tell me a link where I can find it?

Cheers,

Marcus.

Revision history for this message
Best Jérôme Duriez (jduriez) said :
#3

Hi,

As for saving a classical image file from your plot window (the one obtained in Yade using plot.plot() ), it is quite easy using the noShow attribute of plot.plot() function, see the doc at

https://yade-dem.org/doc/yade.plot.html#yade.plot.plot (the example here is about .pdf, it is exactely the same for .png for instance)

Revision history for this message
Marcus Moravia (mgmoravia) said :
#4

Thanks Jérôme Duriez, that solved my question.

Revision history for this message
Marcus Moravia (mgmoravia) said :
#5

Hi Jérôme,

You shared what was missing for me. Now I understand 'matplotlib' that Klaus put in parentheses.

Thanks a lot for help me.

Marcus.