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.
- 1.
coords
— A structured collection of 3D coordinates. - 2.
formex
— Formex algebra in Python - 3.
mesh
— Finite element meshes in pyFormex. - 4.
arraytools
— A collection of numerical utilities. - 5.
script
— Basic pyFormex script functions - 6.
gui.draw
— Create 3D graphical representations. - 7.
colors
— Playing with colors.
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.
- 8.
adjacency
— A class for storing and handling adjacency tables. - 9.
apps
— pyFormex application loading. - 10.
attributes
— Attributes - 11.
candy
— Predefined geometries for a special purpose. - 12.
cmdtools
— pyFormex command line tools - 13.
collection
— Tools for handling collections of elements belonging to multiple parts. - 14.
config
— A general yet simple configuration class. - 15.
connectivity
— A class and functions for handling nodal connectivity. - 16.
coordsys
— Coordinate Systems. - 17.
curve
— Handling curves in pyFormex - 18.
database
— A simple Database class - 19.
elements
— Definition of elements for theMesh
model - 20.
field
— Field data defined over a geometry. - 21.
fileread
— Read geometry from files in a number of formats. - 22.
filetools
— A collection of file utilities. - 23.
filewrite
— Write geometry to file in a whole number of formats. - 24.
flatkeydb
— Flat Text File Database. - 25.
geometry
— A generic interface to the Coords transformation methods - 26.
geomfile
— Export/import of files in pyFormex’s native PGF format - 27.
geomtools
— Basic geometrical operations. - 28.
globalformat
— Set global ouput format for built-in types. - 29.
inertia
— Compute inertia related quantities of geometrical models. - 30.
main
— pyFormex main module - 31.
multi
— Framework for multi-processing in pyFormex - 32.
mydict
— Extensions to Python’s built-in dict class. - 33.
olist
— Some convenient shortcuts for common list operations. - 34.
options
— pyFormex command line options - 35.
path
— Object oriented filesystem paths. - 36.
polygons
— Polygon meshes. - 37.
process
— Executing external commands. - 38.
project
— project.py - 39.
pzffile
— A multifunctional file format for saving pyFormex geometry or projects. - 40.
simple
— Predefined geometries with a simple shape. - 41.
software
— Detecting and checking installed software - 42.
timer
— Timer: Measuring elapsed time. - 43.
track
— Add tracking facilities to any class. - 44.
trisurface
— Operations on triangulated surfaces. - 45.
utils
— A collection of miscellaneous utility functions. - 46.
varray
— Working with variable width tables.
pyFormex GUI modules¶
These modules create the components of the pyFormex GUI. They are located under pyformex/gui. They depend on the Qt4 framework.
- 47.
gui.appMenu
— Menu with pyFormex apps. - 48.
gui.colorscale
— Mapping numerical values into colors. - 49.
gui.dialogs
— Specialized dialogs for the pyFormex GUI. - 50.
gui.drawlock
— A locking mechanism for the drawing functions. - 51.
gui.guifunc
— GUI support functions. - 52.
gui.guimain
— Graphical User Interface for pyFormex. - 53.
gui.image
— Saving OpenGL renderings to image files. - 54.
gui.menu
— Menus for the pyFormex GUI. - 55.
gui.pyconsole
— Interactive Python console in a Qt widget. - 56.
gui.qtcanvas
— Interactive OpenGL Canvas embedded in a Qt widget. - 57.
gui.qtgl
— Qt OpenGL format - 58.
gui.qtutils
— General Qt utility functions. - 59.
gui.signals
— signals.py: Definition of our own signals used in the GUI communication. - 60.
gui.toolbar
— Toolbars for the pyFormex GUI. - 61.
gui.viewport
— Multiple OpenGL viewports in a Qt widget. - 62.
gui.views
— Predefined camera viewing directions - 63.
gui.widgets
— Widgets and dialogs for the pyFormex GUI
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.
- 64.
plugins.bifmesh
— Vascular Sweeping Mesher - 65.
plugins.cameratools
— Camera tools - 66.
plugins.ccxdat
— - 67.
plugins.ccxinp
— Interface with Abaqus/Calculix FE input files (.inp). - 68.
plugins.datareader
— Numerical data reader - 69.
plugins.dicomstack
— Convert bitmap images into numpy arrays. - 70.
plugins.dxf
— Read/write geometry in DXF format. - 71.
plugins.fe
— Finite Element Models in pyFormex. - 72.
plugins.fe_abq
— Export finite element models in Abaqus™ input file format. - 73.
plugins.fe_post
— A class for holding results from Finite Element simulations. - 74.
plugins.flavia
— - 75.
plugins.gts_itf
— Operations on triangulated surfaces using GTS functions. - 76.
plugins.http_server
— Local http server and html file viewer - 77.
plugins.imagearray
— Convert bitmap images into numpy arrays. - 78.
plugins.isopar
— Isoparametric transformations - 79.
plugins.isosurface
— Isosurface: surface reconstruction algorithms - 80.
plugins.lima
— Lindenmayer Systems - 81.
plugins.mesh_io
— - 82.
plugins.neu_exp
— Gambit neutral file exporter. - 83.
plugins.nurbs
— Using NURBS in pyFormex. - 84.
plugins.objects
— Selection of objects from the global dictionary. - 85.
plugins.partition
— Partitioning tools - 86.
plugins.plot2d
— plot2d.py - 87.
plugins.polygon
— Polygonal facets. - 88.
plugins.polynomial
— Polynomials - 89.
plugins.postproc
— Postprocessing functions - 90.
plugins.properties
— General framework for attributing properties to geometrical elements. - 91.
plugins.section2d
— Some functions operating on 2D structures. - 92.
plugins.sectionize
— sectionize.py - 93.
plugins.tetgen
— Interface with tetgen - 94.
plugins.tools
— A collection of graphical tools for pyFormex. - 95.
plugins.turtle
— Turtle graphics for pyFormex - 96.
plugins.units
— A Python wrapper for unit conversion of physical quantities. - 97.
plugins.web
— Tools to access files from the web - 98.
plugins.webgl
— View and manipulate 3D models in your browser.
pyFormex OpenGL modules¶
These modules are responsible for rendering the 3D models and depend on OpenGL. These modules are located under pyformex/opengl.
- 99.
opengl.actors
— OpenGL Actors. - 100.
opengl.camera
— OpenGL camera handling - 101.
opengl.canvas
— This implements an OpenGL drawing widget for painting 3D scenes. - 102.
opengl.canvas_settings
— This modules defines the CanvasSettings class - 103.
opengl.decors
— Decorations for the OpenGL canvas. - 104.
opengl.drawable
— OpenGL rendering objects for the new OpenGL2 engine. - 105.
opengl.matrix
— opengl/matrix.py - 106.
opengl.objectdialog
— Interactive modification of the rendered scene - 107.
opengl.renderer
— opengl/renderer.py - 108.
opengl.sanitize
— Sanitize data before rendering. - 109.
opengl.scene
— OpenGL 3D scene. - 110.
opengl.shader
— OpenGL shader programs - 111.
opengl.textext
— Text rendering on the OpenGL canvas. - 112.
opengl.texture
— Texture rendering.
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.
- 113.
lib.misc_c
— Miscellaneous accelerated low level functions. - 114.
lib.misc_e
— Python equivalents of the functions inlib.misc_c
- 115.
lib.nurbs_c
— Accelerated NURBS functions - 116.
lib.nurbs_e
— Python equivalents of the functions in lib.nurbs_c - 117.
lib.clust_c
— Accelerated cluster optimization - 118.
lib.clust
— Point based clustering module.