[Gmsh] generation of screenshots in non-interactive mode

Mikhail Artemiev artemiev.mikhail at gmail.com
Thu Sep 12 10:14:36 CEST 2013


Hi all!

I would like to rise this old topic
http://geuz.org/pipermail/gmsh/2009/004300.html

I need to get a screenshot of a mesh, and I use the following .geo file for
that:

<print.geo>
Merge "mesh.msh";
//Draw; // doesn't influence on the result either
           // in interactive and non-interactive mode
Print "view.jpg";
Exit;

I use gmsh with the following options:

$gmsh --info

Version          : 2.8.2
GUI toolkit      : FLTK 1.3.0
License          : GNU General Public License
Build OS         : Linux
Build options    : Ann Bamg Bfgs Blas(Generic) Blossom Chaco DIntegration
Dlopen Fltk Gmm Jpeg Kbipack Lapack(Generic) LinuxJoystick MathEx Mesh
Metis Mmg3d Mpeg NativeFileChooser Netgen OSMesa OneLab OneLabMetamodel
OpenCascade OpenGL OptHom Parser Plugins Post RTree Salome Solver
Tetgen(1.5) Voro3D Zlib
Build date       : 20130912
Build host       : artemiev-laptop
Packager         : artemiev
Web site         : http://www.geuz.org/gmsh/
Mailing list     : gmsh at geuz.org

So gmsh is built with the OSMesa support.
When I type the command:

$gmsh print.geo

the gmsh's window opens and closes -> the "view.jpg" file is created.
When I try to do the same in non-interactive mode:

$gmsh print.geo -

I have the following output:

Info    : Running 'gmsh print.geo -' [Gmsh 2.8.2, 1 node, max. 1 thread]
Info    : Started on Thu Sep 12 14:58:07 2013
Info    : Reading 'print.geo'...
Info    : Reading 'mesh.msh'...
Info    : 870 vertices
Info    : Vertex numbering is dense
Info    : 1710 elements
Info    : Done reading 'mesh.msh'
Info    : Writing 'view.jpg'...
Info    : Done writing 'view.jpg'

but the "view.jpg" is not created.
What am I missing?

Thanks in advance,
Mikhail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20130912/2cf87ef1/attachment.html>