The most important geometrical object in pyFormex is the Formex class. A Formex can describe a variety of geometrical objects: points, lines, surfaces, volumes. The most simple geometrical object is the point, which in three dimensions is only determined by its coordinates (
x,y,z), which in pyFormex will be numbered (
0,1,2) for convenience. Higher order geometrical objects are defined by a collection of points. In pyFormex terms, we call the number of points of an object its plexitude.
A Formex is a collection of geometrical objects of the same plexitude. The objects in the collection are called the elements of the Formex. A Formex whose elements have plexitude is also called an
-plex Formex. Internally, the coordinates of the points are stored in a numerical array2.1 with three dimensions. The coordinates of a single point are stored along the last axis (2) of the Formex; all the points of an element are stored along the second axis (1); different elements are stored along the first axis (0) of the Formex. The figure 2.2 schematizes the structure of a Formex.
Warning: The beginning user should be aware not to confuse the three axes of a Formex with the axes of the 3D space. Both are numbered 0..2. The three coordinate axes form the components of the last axis of a Formex.
For simplicity of the implemented algorithms, internally pyFormex only deals with 3D geometry. This means that the third axis of a Formex always has length 3. You can however import 2D geometry: all points will be given a third coordinate . If you restrict your operations to transformations in the
-plane, it suffices to extract just the first two coordinates to get the transformed 2D geometry.
The Formex object F
can be indexed just like a numerical array:
F[i]
returns the element with index (counting from
). For a Formex with plexitude
, the result will be an array with shape
, conttaining all the points of the element. Then,
F[i][j]
will be a -shaped array containing the coordinates of point
of element
. Finally,
F[i][j][k]
is a floating point value representing a single coordinate of that point.