| Contents | Index |
plot::Waterman – Waterman polyhedra
plot::Waterman(r) creates the Waterman polyhedron of radius
.
Call:
plot::Waterman(r, <a = amin .. amax>, Options)
Parameters:
|
r: |
an arithmetical expression: the radius of the polyhedron (see below for details). |
See Also:
Details:
Waterman polyhedra, invented around 1990 by Steve Waterman, form a vast family of polyhedra. Some of them have a number of nice properties like multiple symmetries, or very interesting and regular shapes. Some other are just a bunch of faces formed out of irregular convex polygons.
Waterman polyhedra result from the examination of balls in face-centered cubic close packing (which is one of the two densest packings of equally sized balls in 3D space, according to the Kepler Conjecture, proofed by Hales and Ferguson, 1997-2005). A single layer of spheres (of radius
) in this packing looks like this:

The close packing results from placing several of these layers over one another, shifted to optimally fill the gaps (in very much the same way your grocery store puts apples and oranges on display):

Given a radius
and a center
(which we let default to
), now consider all those centers of spheres in this packing which fall into the sphere of radius
around
:

The convex hull of these points is the Waterman polyhedron of the given radius and center:


|
AffectViewingBox = TRUE |
influence of objects on the ViewingBox of a scene |
|
Center = [0, 0, 0] |
center of objects, rotation center |
|
CenterX = 0 |
center of objects, rotation center, x-component |
|
CenterY = 0 |
center of objects, rotation center, y-component |
|
CenterZ = 0 |
center of objects, rotation center, z-component |
|
the main color |
|
|
color of areas and surfaces |
|
|
second color of areas and surfaces for color blends |
|
|
FillColorDirection = [0, 0, 1] |
the direction of color transitions on surfaces |
|
x-component of the direction of color transitions on surfaces |
|
|
y-component of the direction of color transitions on surfaces |
|
|
z-component of the direction of color transitions on surfaces |
|
|
functional area/surface coloring |
|
|
FillColorType = Flat |
surface filling types |
|
Filled = TRUE |
filled or transparent areas and surfaces |
|
Frames = 50 |
the number of frames in an animation |
|
makes a legend entry |
|
|
LegendEntry = FALSE |
add this object to the legend? |
|
short explanatory text for legend |
|
|
color of lines |
|
|
color of lines |
|
|
LineColorDirection = [0, 1, 1] |
the direction of color transitions on lines |
|
x-component of the direction of color transitions on lines |
|
|
y-component of the direction of color transitions on lines |
|
|
z-component of the direction of color transitions on lines |
|
|
functional line coloring |
|
|
LineColorType = Flat |
line coloring types |
|
LineStyle = Solid |
solid, dashed or dotted lines? |
|
LinesVisible = TRUE |
visibility of lines |
|
LineWidth = 0.25 |
width of lines |
|
the name of a plot object (for browser and legend) |
|
|
initial value of the animation parameter |
|
|
end value of the animation parameter |
|
|
name of the animation parameter |
|
|
range of the animation parameter |
|
|
PointSize = 1.5 |
the size of points |
|
PointStyle = FilledCircles |
the presentation style of points |
|
PointsVisible = FALSE |
visibility of mesh points |
|
radius of circles, spheres etc. |
|
|
Shading = Smooth |
smooth color blend of surfaces |
|
TimeBegin = 0.0 |
start time of the animation |
|
TimeEnd = 10.0 |
end time of the animation |
|
TimeRange = 0.0 .. 10.0 |
the real time span of an animation |
|
object title |
|
|
TitleAlignment = Center |
horizontal alignment of titles w.r.t. their coordinates |
|
TitleFont = ["sans-serif", 11] |
font of object titles |
|
position of object titles |
|
|
position of object titles, x component |
|
|
position of object titles, y component |
|
|
position of object titles, z component |
|
|
Visible = TRUE |
visibility |
|
object visible after this time value |
|
|
VisibleAfterEnd = TRUE |
object visible after its animation time ended? |
|
object visible until this time value |
|
|
VisibleBeforeBegin = TRUE |
object visible before its animation time starts? |
|
object visible during this time range |
Example 1
With increasing radius, Waterman polyhedra get ever closer to spheres:
plot(plot::Waterman(r, r=0..10,
PointsVisible, PointSize=1,
LineColor=RGB::Black,
Color=RGB::Red.[0.75]),
plot::Sphere(r, [0,0,0], r=0..10,
Color=RGB::Yellow.[0.3]),
CameraDirection=[2,10,1])


Example 2
Waterman polyhedra have a rather general definition and can be made from spheres centered anywhere:
plot(plot::Waterman(5, Center=[0,0,0]))

plot(plot::Waterman(5, Center=[0,0,1]))

To translate or scale a Waterman polyhedron, use plot::Translate3d and plot::Scale3d:
n := 3:
r := i -> 3/2+sqrt(i+1):
plot(plot::Translate3d([i mod n, i div n, 0],
plot::Scale3d([1/(3*r(i)) $ 3],
plot::Waterman(r(i), Color=RGB::random())))
$ i = 0..n^2-1, Axes=None)

Example 3
As usual, many attributes can be animated, although by the nature of Waterman polyhedra, the resulting animation will not be smooth:
plot(plot::Waterman(5, Center=[a/PI, cos(a), 0],
a=0..2*PI),
AnimationStyle=BackAndForth, CameraDirection=[0,0.1,1])


Example 4
The LineColorFunction and FillColorFunction attributes can be set to functions which get indices of the currently painted surfacepolygon and its current vertex as fourth and fifth argument, repectively. This allows to color the polygons individually:
colors := [RGB::random() $ i = 1..42]:
plot(plot::Waterman(5, FillColorFunction=((x,y,z,i) -> colors[i])))

Another way of getting random colors which remain constant for each polygon is to use a procedure with option remember:
col :=
proc(n)
option remember;
begin
RGB::fromHSV([360*frandom(), 1, 1]);
end:
plot(plot::Waterman(7, FillColorFunction=((x,y,z,i) -> col(i))))

Background:
plot::Waterman uses plot::hull (and therefore, the Geometry Centre's qhull code) to compute the convex hull of the coordinates. Most of the remaining code has been contributed by Mirek Majewski.

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |