pyFormex reference manual

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.

Autoloaded modules

The definitions in these modules are always available to your scripts, without the need to explicitely import them.

Other pyFormex core modules

Together with the autoloaded modules, the following modules located under the main pyformex path are considered to belong to the pyformex core functionality.

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 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 OpenGL modules

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

pyFormex plugin menus

Plugin menus are optionally loadable menus for the pyFormex GUI, providing specialized interactive functionality. Because these are still under heavy development, they are currently not documented. Look to the source code or try them out in the GUI. They can be loaded from the File menu option and switched on permanently from the Settings menu.

Currently avaliable:

  • geometry_menu

  • formex_menu

  • surface_menu

  • tools_menu

  • draw2d_menu

  • nurbs_menu

  • dxf_tools

  • postproc_menu

  • bifmesh_menu

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.