pyFormex reference manual

Warning

This is currently under revision, as pyFormex 4 has changed substantially.

This reference manual describes the classes in functions defined in most of the pyFormex modules. It was built automatically from the docstrings in the pyFormex sources. The pyFormex modules are placed in three paths:

  • pyformex contains the core functionality, with most of the geometrical transformations, the pyFormex scripting language and utilities,

  • pyformex/gui contains all the modules that form the interactive graphical user interface,

  • pyformex/plugins contains extensions that are not considered to be essential parts of pyFormex. They usually provide additional functionality for specific applications.

Some of the modules are loaded automatically when pyFormex is started. Currently this is the case with the modules coords, formex, arraytools, script and, if the GUI is used, draw and colors. All the public definitions in these modules are available to pyFormex scripts without explicitly importing them. Also available is the complete numpy namespace, because it is imported by arraytools.

The definitions in the other modules can only be accessed using the normal Python import statements.

pyFormex core modules

These modules contain the basic functionality of pyFormex. All its definitions can be used with or without the pyFormex GUI. These include the import classes for 3D geometrical modeling, but also a whole lot of low level utilities.

pyFormex GUI modules

These modules create the components of the pyFormex GUI. They are located under pyformex/gui. They depend on the Qt4 framework.

pyFormex plugin menus

Plugin menus are optionally loadable menus for the pyFormex GUI, providing specialized interactive functionality. These menus are displayed at the top menubar of the GUI. They can be closed (removed) and reloaded. Reloading is especially useful during development of the menu. The initially displayed menus can be configured from the Settings menu. Users can add their own menus to the menubar.

pyFormex plugins

Plugin modules extend the basic pyFormex functions to a variety of specific applications. Apart from being located under the pyformex/plugins path, these modules are in no way different from other pyFormex modules.

pyFormex Finite Element modules

The fe subpackage contains some modules oriented to Finitie Element operations.

pyFormex OpenGL modules

These modules are responsible for rendering the 3D models and depend on OpenGL. These modules are located under pyformex/opengl.

pyFormex acceleration library

The acceleration library contains some compiled C-versions of critical (parts of) algorithms that are known to take long computing times that are unacceptable for large data sets. Most of the functions in our C-libraries also exist in a Python version. Those versions are intended for studying the algorithm and as a last resort in case the C versions do not compile on your system. By default, pyFormex will try to compile and use the accelerated versions. You can force the use of the slower Python versions by adding the --nouselib option to the pyformex command.

Normally the user should not have to call any of the library functions directly. They can be accessed from Python wrapper functions in the appropriate places. Be aware that, especially in the case of the accelerated versions, one should pass the precise C-type objects. The accelerated C-extensions have a name ending in _, the Python versions end in _e. To import the modules, just use the name with underscore:

from pyformex.lib import misc
from pyformex.lib import nurbs
from pyformex.lib import clust

The initialization code will have loaded the appropriate version already.

pyFormex applications

pyFormex is an application building framework. It contains a large set of examples that show some of its possibilities. But it comes also with some simple functional applications that can readily be used for some useful purpose. They are found under the App->Apps and Script->Scripts menus. Some of them contain functions that have a broader use than just that application.