The Formex class does not attribute any geometrical interpretation to the grouping of points in an element. This is left to the user, or to subclasses.
Thus, an element consisting of two points could (and usually will) represent a straight line segment between this two points. But the points could just as well be the two opposite corners of a rectangle. An element with plexitude 3 (in short: plex-3 element) could be interpreted as a triangle or as two straight line segments or as a curved line or even as a circle through these points. If it is a triangle, it could be either the circumference of the triangle or the part of the plane inside that circumference. As far as the Formex class concerns, each element is just a set of points.
All elements in a Formex must have the same number of points, but you can construct Formex instances with any (positive) number of nodes per element. A plex-1 Formex is just a collection of unconnected nodes (each element is a single point).
One way of attaching other data (than the coordinates of its points) to the elements of a Formex, is by using the 'property' attribute. The property is an array holding one integer value for each of the elements of the Formex. The interpretation of this property value is again completely left to the user. It could be a code for the type of element, or for the color to draw this element with. Often it will be used as an index into some other (possibly complex) data structure holding all the characteristics of that element. By including this property index into the Formex class, we make sure that when new elements are constructed from existing ones, the element properties are automatically propagated.
data=[[[]]],prop=None) |
If 2D coordinates are given, a 3-rd coordinate 0.0 will be added. Internally, a Forme always has 3D coordinates.
Example: F = Formex([[[1,0],[0,1]],[[0,1],[1,2]]])
creates a Formex with two elements, each having 2 points in the global z-plane.
If a prop argument is specified, the setProp() method will be called with this argument to assign the properties to the Formex.
If no data are specified, an empty Formex is created. The use of empty Formices is not very well tested yet, and therefore not not encouraged.