## Data StructuresEffective 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.
We next define a "-representation" to represent 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 Mathematica provides a package of polyhedra, but in a different form. The built-in function returns a list of a built-in polyhedron's vertices, in form. The built-in function `Vertices` provides a list of its faces, where each face is represented as a list of indices into `Faces` . We define a function `Vertices` to convert a built-in polyhedron from that format into our format.
`builtInPoly`
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
For example, to load the
Converted by Mathematica
September 30, 1999
[Prev Page][Next Page] |