2. Gmsh

Examples of QTCAD scripts are stored in qtcad/examples. These examples use mesh files that may be produced from geometry files (with the .geo extension) stored in qtcad/examples/tutorials/meshes and qtcad/examples/practical_application/meshes using Gmsh.

To install Gmsh inside the qtcad virtual environment (see QTCAD), use

pip install gmsh

To produce a .msh2 (Gmsh mesh file) from a .geo file, use

gmsh path_to_file.geo

In Linux or Mac, it is possible to produce all mesh files used in the examples with

gmsh qtcad/examples/*/meshes/*.geo

Note that mesh files can be quite heavy, so that it may be a good idea to delete them when they are not needed anymore.

In addition, it is sometimes useful to run Gmsh on a .geo script without launching the Graphical User Interface. This is particularly useful when generating meshes on a remote workstation or cluster, and can be done with

gmsh path_to_file.geo -

Once relevant mesh files are produced, examples may be run from the root of the qtcad folder, and inside the qtcad virtual environment with

python examples/folder_name/script_name.py

The user is free to create his/her own scripts in any folder to run them, provided that this is done in the virtual environment.

For more information on Gmsh, please visit gmsh.info.