mathPAD Online

mathPAD Logo

The Magazine of the MuPAD Research Group, Vol. 15, Year 2006

Visualizing Waterman Polyhedra with MuPAD

Part 2: Waterman library in MuPAD

by M. Majewski

Zayed University, United Arab Emirates

The Waterman library in MuPAD was created as a response to Steve Waterman question if MuPAD can be effectively used to visualize large objects with thousands of polygons. First attempt was to create a procedure that will produce only polyhedra w1,n , i.e. Waterman polyhedra from the first sequence, the one with origin in (0,0,0). The same code with significant changes was used to produce polyhedra wk,n, where k=1..7, as well as the procedure to explore the space of Waterman polyhedra. Finally, some additional tools for visualizing CCP spheres and CCP grid were added.

At the time of writing this text, February 2006, the Waterman library is not a part of MuPAD original setup. However, there is a chance that tools for exploring Waterman polyhedra, based on this library, will be included in one of the next versions of MuPAD.

Waterman library installation and configuration

Installation of the library requires two files waterman.mb and qconvex.exe. The QConvex program is part of the Qhull library developed at the National Science and Technology Research Center for Computation and Visualization of Geometric Structures, The Geometry Center, University of Minnesota. The complete Qhull library can be downloaded from http://www.qhull.org. With the waterman.mb library there is enclosed the qconvex.exe only.

Both files should be copied into the folder where in user configuration of MuPAD the variable READPATH points up. For example, in my configuration of MuPAD, all my works are in the folder

d:\documents\mupad

Therefore in MuPAD I have to execute command:

READPATH := "D:\\Documents\\MuPAD\\": 

Finally, in order to have access to qconvex.exe

from MuPAD, we need also additional variable
QCONVEX_PATH := "D:\\Documents\\MuPAD\\": 

If both files were copied to the folder mentioned above, we can start a new MuPAD notebook with commands:

READPATH := "D:\\Documents\\MuPAD\\":
read("waterman.mb")
QCONVEX_PATH := "D:\\Documents\\MuPAD\\": 

Now we can execute any procedure that is part of the library. For example,

plot(WatermanPoly(3,4), Scaling=Constrained) 

The Waterman library contains the following procedures:

CCPoints(xrange, yrange, zrange)-procedure to calculate CCP points, obtained output is a plot object that can be displayed on the screen using the plot command. Here is an example,

plot(CCPoints(-2..2,-2..2,-2..2), Scaling=Constrained) 

Result was shown in the figure 3.

CCSpheres(xrange, yrange, zrange) - procedure to calculate CCP spheres arrangement for a parallelepiped defined by xrange, yrange, zrange. Note, the output will contain all CCP spheres that have centers inside of the parallelepiped. Here is an example,

plot(CCSpheres(-3..3,-3..3,-3..3), Scaling=Constrained) 
figure08.png

WatermanData([x,y,z],r) - procedure to calculate data for all procedures displaying Waterman polyhedra.

WatermanSpheres([x,y,z],r) - procedure to calculate all CCP spheres, with centers on, or inside, of a sphere with the given radius r and center [x,y,z]

. Obtained result is a plot object that can be displayed using the plot

command, for example like here,

plot(WatermanSpheres([1,0,0],3), Axes=Boxed)      

WatermanPoints([x,y,z],r) - procedure to calculate centers (CCP points) of all spheres produced by the WatermanSpheres procedure. Obtained result is a plot object that can be displayed using the plot

command, for example like here,
plot(WatermanPoints([0,0,0],2), PointSize=2)      

WatermanPoly(sequence,number) - procedure to obtain Waterman polyhedra from Mark Newbold's sequences. Obtained result is a plot object that can be displayed using the plot command, for example like here,

 plot(WatermanPoly(2,13), Scaling=Constrained)      

Comment

There is one significant difference between our and Newbold's approach. It may happen that for two, or more radii, we obtain exactly the same Waterman polyhedron, for example w2,7=w2,8. In Mark Newbold's work such multiple polyhedron is counted only once, and it occupies only one position of the sequence. In our implementation identical consecutive polyhedra are treated as separate terms of the sequence.

WatermanExplore([x,y,z],Radius) - is a procedure that can be used to produce a Waterman polyhedron for any point of the 3D space as a center of the polyhedron, and for any positive radius. If such polyhedron does not exist, the output is the point P(x,y,z). In each case obtained result is a plot object that can be displayed with the plot command, for example like here,

plot(WatermanExplore([0.6,0.6,0.6],15), Scaling=Constrained)

Most of the procedures in the Waterman library produce objects with completely random colors. The advantage of this approach is that each face of a polyhedron gets an individual character. Therefore, while discussing properties of a polyhedron we are able to refer to the individual faces of it by using their colors. For example, we can say-- the blue pentagon on the top of the polyhedron is ... etc. There is also a serious disadvantage to such approach. For instance, animation of a polyhedron W((0,0,a),3), where a is the animation parameter, will produce a series of blinking images.

I am sure that coloring polyhedra in MuPAD this is another interesting topic that requires more attention.

Copyright © 2002-2007 mathPAD Online and the authors.