### Data Structures

Effective data structures, appropriate to the problem domain, are essential. To begin with, the star is simply a list of 3-vectors, each given by an coordinate representation. The order of the vectors in the star is not important as it will be treated like a set. For the examples of Figure 3, I chose the following.

In the first case, four vectors in general position were selected (i.e., no three vectors are coplanar, so the result is bounded by parallelograms). In the second case, three vectors lie in a plane, and so the zonohedron contains hexagons in parallel planes.

Figure 4. The parts of an n-zone zonohedron are named with an n-vector of 0's 1's, and -1's. The star for (a) is (c); the star for (b) is (d). Both have four zones, but in (b,d), three zonal directions are coplanar giving a hexagonal face.

We next define a "-representation" to represent parts, such as faces, edges, and vertices. Observe that there are three possible positions for a part relative to the th zone: the part can be entirely on one side of the th zone, entirely on the other side of the zone, or (if not a vertex) it can span the zone. We represent any part with a list of n elements in which the th component is respectively 1, , or 0. Figure 4 illustrates this representation with the examples of Figure 3. The sign of any ±1 is understood in terms of the corresponding element of the star. Observe that a hexagon representation has three zeros as it spans three zones, a parallelogram has two zeros, an edge has one zero, and a vertex representation has zero zeros (i.e., it consists entirely of 1's and 's). These are just the Cartesian coordinates in -space of the center of the edge-two hypercube component, which is the preimage of the part.

One useful property of this representation is that a part is centrally opposite the part . For another, notice that a part is a subpart of iff is 0 in all positions where they differ. So, to find the two endpoints of an edge, we replace the 0 in its representation first with 1 and then with -1. There is also a simple method to find the edge opposite a given edge, , within a given face, . We simply negate those components of , which are zero in , while keeping the other components unchanged (i.e., compute ).

Finally, we need a data structure for a complete polyhedron, which can be the input and output of a `zonohedrify` function, so we can nest it. The format we will use is that a polyhedron is a list of faces, a face is a list of vertices (in a cyclic order around the perimeter), and a vertex is an triple. Mathematica provides a package of polyhedra, but in a different form. The built-in function `Vertices` returns a list of a built-in polyhedron's vertices, in form. The built-in function `Faces` provides a list of its faces, where each face is represented as a list of indices into `Vertices`. We define a function `builtInPoly` to convert a built-in polyhedron from that format into our format.

We can easily extract the vertices of a polyhedron in our format.

The following function takes a polyhedron in our format and displays it with Mathematica's 3D graphics. Each face must be headed with `Polygon`.

For example, to load the `Polyhedra` package and then convert and display the built-in icosahedron, we type the following.

Converted by Mathematica      September 30, 1999

[Prev Page][Next Page]