pyFormex reference manual — pyFormex 1.0.5 documentation

# pyFormex reference manual

Abstract

This is the reference manual for pyFormex 1.0.5. It describes most of the classes and functions defined in the pyFormex modules. It was built automatically from the pyFormex sources and is therefore the ultimate reference document if you want to look up the precise arguments (and their meaning) of any class constructor or function in pyFormex. The Index and Module Index may be helpful in navigating through this document.

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. `arraytools` — A collection of numerical utilities.
- 4. `script` — Basic pyFormex script functions
- 5. `gui.draw` — Create 3D graphical representations.
- 6. `opengl.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.

- 7. `mesh` — Finite element meshes in pyFormex.
- 8. `trisurface` — Operations on triangulated surfaces.
- 9. `coordsys` — Coordinate Systems.
- 10. `geometry` — A generic interface to the Coords transformation methods
- 11. `connectivity` — A class and functions for handling nodal connectivity.
- 12. `elements` — Definition of elements.
- 13. `field` — Field data in pyFormex.
- 14. `utils` — A collection of miscellaneous utility functions.
- 15. `varray` — Working with variable width tables.
- 16. `adjacency` — A class for storing and handling adjacency tables.
- 17. `simple` — Predefined geometries with a simple shape.
- 18. `project` — project.py
- 19. `geomfile` — Handling pyFormex Geometry Files
- 20. `geomtools` — Basic geometrical operations.
- 21. `inertia` — Compute inertia related quantities of geometrical models.
- 22. `fileread` — Read geometry from file in a whole number of formats.
- 23. `filewrite` — Write geometry to file in a whole number of formats.
- 24. `multi` — Framework for multi-processing in pyFormex
- 25. `software` — software.py

## pyFormex GUI modules

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

- 26. `gui.widgets` — A collection of custom widgets used in the pyFormex GUI
- 27. `gui.menu` — Menus for the pyFormex GUI.
- 28. `gui.colorscale` — Mapping numerical values into colors.
- 29. `gui.viewport` — Interactive OpenGL Canvas embedded in a Qt4 widget.
- 30. `gui.image` — Saving OpenGL renderings to image files.
- 31. `gui.imageViewer` — A general image viewer
- 32. `gui.appMenu` — Menu with pyFormex apps.
- 33. `gui.toolbar` — Toolbars for the pyFormex GUI.

## pyFormex plugins

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

- 34. `plugins.bifmesh` — Vascular Sweeping Mesher
- 35. `plugins.cameratools` — Camera tools
- 36. `plugins.ccxdat` —
- 37. `plugins.ccxinp` —
- 38. `plugins.curve` — Definition of curves in pyFormex.
- 39. `plugins.datareader` — Numerical data reader
- 40. `plugins.dxf` — Read/write geometry in DXF format.
- 41. `plugins.export` — Classes and functions for exporting geometry in various formats.
- 42. `plugins.fe` — Finite Element Models in pyFormex.
- 43. `plugins.fe_abq` — Export finite element models in Abaqus™ input file format.
- 44. `plugins.fe_post` — A class for holding results from Finite Element simulations.
- 45. `plugins.flavia` —
- 46. `plugins.imagearray` — Convert bitmap images into numpy arrays.
- 47. `plugins.isopar` — Isoparametric transformations
- 48. `plugins.isosurface` — Isosurface: surface reconstruction algorithms
- 49. `plugins.lima` — Lindenmayer Systems
- 50. `plugins.neu_exp` — Gambit neutral file exporter.
- 51. `plugins.nurbs` — Using NURBS in pyFormex.
- 52. `plugins.objects` — Selection of objects from the global dictionary.
- 53. `plugins.partition` — Partitioning tools
- 54. `plugins.plot2d` — plot2d.py
- 55. `plugins.polygon` — Polygonal facets.
- 56. `plugins.polynomial` — Polynomials
- 57. `plugins.postproc` — Postprocessing functions
- 58. `plugins.properties` — General framework for attributing properties to geometrical elements.
- 59. `plugins.pyformex_gts` — Operations on triangulated surfaces using GTS functions.
- 60. `plugins.section2d` — Some functions operating on 2D structures.
- 61. `plugins.sectionize` — sectionize.py
- 62. `plugins.tetgen` — Interface with tetgen
- 63. `plugins.tools` — tools.py
- 64. `plugins.turtle` — Turtle graphics for pyFormex
- 65. `plugins.units` — A Python wrapper for unit conversion of physical quantities.
- 66. `plugins.web` — Tools to access files from the web
- 67. `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. Currently, pyFormex contains two rendering engines. The new engine’s modules are located under pyformex/opengl.

- 68. `opengl.camera` — OpenGL camera handling
- 69. `opengl.canvas` — This implements an OpenGL drawing widget for painting 3D scenes.
- 70. `opengl.decors` — Decorations for the OpenGL canvas.
- 71. `opengl.drawable` — OpenGL rendering objects for the new OpenGL2 engine.
- 72. `opengl.matrix` — opengl/matrix.py
- 73. `opengl.objectdialog` — Interactive modification of the rendered scene
- 74. `opengl.renderer` — opengl/renderer.py
- 75. `opengl.sanitize` — Sanitize data before rendering.
- 76. `opengl.scene` — This implements an OpenGL drawing widget for painting 3D scenes.
- 77. `opengl.shader` — OpenGL shader programs
- 78. `opengl.textext` — Text rendering on the OpenGL canvas.
- 79. `opengl.texture` — Texture rendering.

## 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
- jobs menu
- postproc_menu
- bifmesh_menu

## pyFormex tools

The main pyformex path contains a number of modules that are not considered to be part of the pyFormex core, but are rather tools that were used in the implementation of other modules, but can also be useful elsewhere.

- 80. `olist` — Some convenient shortcuts for common list operations.
- 81. `mydict` —
- 82. `odict` — Specialized dictionary types.
- 83. `attributes` — Attributes
- 84. `collection` — Tools for handling collections of elements belonging to multiple parts.
- 85. `config` — A general yet simple configuration class.
- 86. `flatkeydb` — Flat Text File Database.
- 87. `timer` — A timer class.