pyFormex is a tool for generating, manipulating and transforming large geometrical models of 3D structures by sequences of mathematical transformations. Thanks to a powerful (Python based) scripting language, pyFormex is very well suited for the automated design of spatial frame structures. It provides a wide range of operations on surface meshes, like STL type triangulated surfaces. There are provisions to import medical scan images. pyFormex can also be used as a pre- and post-processor for Finite Element analysis programs. Finally, it might be used just for creating some nice graphics.
Using pyFormex, the topology of the elements and the final geometrical form can be decoupled. Often, topology is created first and then mapped onto the geometry. Through the scripting language, the user can define any sequence of transformations, built from provided or user defined functions. This way, building parametric models becomes a natural thing.
While pyFormex is still under development (see the project page at http://savannah.nongnu.org/projects/pyformex/), it already provides a fairly stable scripting language and an OpenGL GUI environment for displaying and manipulating the generated structures.
We detail here only the installation on Linux platforms.
Essential:
- python: http://www.python.org (version 2.4 or higher; 2.5 recommended)
- numpy: /http://numpy.scipy.org/ (version 1.0 or higher; 1.1 recommended)
- Qt4: http://www.trolltech.com/products/qt
- PyQt4: http://www.riverbankcomputing.co.uk/pyqt/index.php
- PyOpenGL: http://pyopengl.sourceforge.net/
To compile the acceleration library (highly recommended!), you will also need the appropriate header Python and OpenGL header files.
Further, we recommend to install the following for extended functionality:
- python-gnuplot
- python-doc
- python-scipy
- units
- imagemagick
- admesh
For the following extensions, which are not easily packaged format, an install script is provided in this distribution.
- calpy
- pygl2ps
- gts
- tetgen
On Debian (lenny) systems (and Debian-derivatives like Ubuntu) you can install all basic prerequisites and their dependencies with the command:
apt-get install python-qt4-gl python-numpy
If you want to compile the acceleration library (which is highly recommended) you also need the header files:
apt-get install python-dev libgl1-mesa-dev
Install the extras:
apt-get install python-gnuplot python-doc python-scipy units imagemagick admesh
If a previous version of pyFormex was already installed on your system, you may want to remove the older version first before installing the new one. See further (Howto uninstall pyFormex)
We suppose you have installed all the prerequisites and downloaded the pyformex source tarball: pyformex-VERSION.tar.gz
Unpack the pyFormex source tarball:
tar xvzf pyformex-VERSION.tar.gz
Go to the created pyformex directory:
cd pyformex-VERSION
Do (with root privileges) :
python setup.py install --prefix=/usr/local
This will install pyFormex under /usr/local/. You can change the prefix to install in some other place.
After installation you can remove the directory where you unpacked the tarball.
The installation procedure installs everything into a single directory, and creates a symlink to the executable in /usr/local/bin. You can use the command pyformex --whereami to find out where pyFormex is installed.
If you have xdg-utils on your system, the installation procedure will also install a menu and desktop starter for pyFormex.
A pyFormex installation of version 0.5 or later can be removed with the command :
pyformex --remove
and then answering 'yes' to the question.
pyFormex makes use of extra software components to enhance its functionality. While they are not required for the core operation of pyFormex, many users may want to install them. Some of these extras (admesh, units) can easily be installed from your regular distribution repositories. Some extra components however either are not available in packaged format, or the existing packages do not work together well with pyFormex. For these components, the pyFormex distribution contains an adhoc install procedure to help our users with the installation. The procedures are located in dedicated subdirectories of the pyformex-VERSION/pyformex/extra directory of the unpacked release tree. Each subdirectory contains a README
file with installation instructions. It the directory contains a Makefile
, this usually boils down to the usual:
make
make install
Else, an install script install.sh
is included and installation can be done with by executing it from within the subdirectory, with root privileges and with a single parameter 'all':
(sudo) ./install.sh all
gts: Installs some programs to do operations on triangulated surfaces. You need to have the
libgts
and its header files installed. On Debian:apt-get install libgts-dev
- dxfparser: Installs the command
pyformex-dxfparser
, to preprocesses AutoCAD .DXF files for import into pyFormex. - postabq: Installs the command
pyformex-postabq
, to preprocess Abaqus output files (.fil) for import into pyFormex. - gl2ps: Image output to in vector formats (PS, EPS, PDF and SVG). Requires a Python interface, provided by our install procedure.
- calpy: Simple finite element simulation framework. Needed for the
*_calpy
examples. Has to be installed from source, because is has to be compiled against the same numpy version as pyFormex itself.
If the officially released pyFormex packages are not suitable for your needs, you can try installing pyFormex from the Subversion sources. Besides the basic prerequisites (see above), you will also need to have 'Subversion' installed.
The SVN repository on the developer site is accessible by anonymous SVN. The command :
svn co svn://svn.savannah.nongnu.org/pyformex/trunk/pyformex MYDIR
will checkout the source to a local directory MYDIR
. Provided you have all the prerequisites installed, pyFormex can then be run directly from the checked out source with the command:
MYDIR/pyformex/pyformex
If you want to use the compiled accelerator library however, you will have to create it first:
cd MYDIR
make lib
Once you have a checked-out source tree, you can easily sync it to the latest repository version by just issuing the following command from your checkout directory:
svn up
The documentation is included with the pyFormex distribution. Execute the command pyformex --whereami to find out where the pyformex files are installed. The pyformex path contains a directory doc/html with the full html ocumentation. When working with the pyFormex GUI, you can load this local documentation in your browser using the help menu, or view the online documentation at http://pyformex.org/doc.
To use pyFormex, you create a script that builds a structure layout and geometry. Look at the examples to get the feeling of how it is working. Use the File->Play menu selection to display the structure.
The examples and the Python source are relatively well documented.
For any questions or feedback, please go to the pyFormex support tracker at http://savannah.nongnu.org/support/?group=pyformex
If you find any bugs or malfunctions in pyFormex, please submit them to the pyFormex Bug tracker http://savannah.nongnu.org/bugs/?group=pyformex