Efficient Representation of Many Primitives
| Point[{pt1,pt2,...}] | a multipoint consisting of points at pt1, pt2, ... |
| Line[{line1,line2,...}] | a multiline consisting of lines line1, line2, ... |
| Polygon[{poly1,poly2,...}] | a multipolygon consisting of polygons poly1, poly2, ... |
Primitives which can take multiple elements.
Some primitives have multi-element forms that can be processed and rendered more quickly by the
Mathematica front end than the equivalent individual primitives. For large numbers of primitives, using the multi-element forms can also significantly reduce the sizes of notebook files. Notebooks that use multi-element forms can be less than half the size of those that do not, and render up to ten times faster.
Here is a multipoint random distribution.
| Out[1]= |  |
|
| GraphicsComplex[{pt1,pt2,...},data] | a graphics complex in which coordinates given as integers i in graphics primitives in data are taken to be pti |
Primitive for sharing coordinate data among primitives.
When many primitives share the same coordinate data, as in meshes and graphs, further efficiency can be gained by using
GraphicsComplex to factor out the coordinate data. The output of
Mathematica's surface- and graph-plotting functions typically use this representation.
Here is a structure of points and lines that share coordinates.
| Out[2]= |  |
|
In addition to being efficient,
GraphicsComplex is useful interactively. Primitives that share coordinates stay connected when one of them is dragged.
| Out[3]= |  |
|
Any primitive may be used within a
GraphicsComplex, and
GraphicsComplex can be used in both 2D and 3D graphics. Within
GraphicsComplex, coordinate positions in primitives are replaced by indices into the coordinate data in the
GraphicsComplex.
| Out[4]= |  |
|
GraphicsComplex is especially useful for representing meshes of polygons. By using
GraphicsComplex, numerical errors that could cause gaps between adjacent polygons are avoided.
| Out[5]= |  |
|