zonohedron-plot {zonohedra}R Documentation

plot a zonohedron

Description

Plot a zonohedron object in 3D, with many options.

Usage

## S3 method for class 'zonohedron'
plot( x, type='e', pcol=NULL, ecol=NULL, ewd=3, etcol=NA,
        fcol=NULL, falpha=1, normals=FALSE, bgcol="gray40", both=TRUE, ... )

Arguments

x

a zonohedron object as returned by the constructor zonohedron()

type

a string of letter with what parts to draw. If type contains an 'p', then draw a point at the center of each facet. If type contains an 'e', then draw the edges. If type contains an 'f', then draw filled facets.

pcol

The color to use when drawing points. It can be a vector of 2 colors, and then when both is TRUE, the first color is used for one half, and the second color is used for the antipodal half. When pcol is NULL, it is set to c('black','red').

ecol

A vector of colors to use when drawing the edges. Let N be the number of simplified generators of the zonohedron. Each edge is parallel to exactly one of the generators, so this divides the edges into N zones, or belts. ecol can be a vector of N colors, one for each zone. If ecol is shorter than N, it is extended to length N using the last color. If ecol is longer than N, the extra colors are ignored. If ecol is NULL, it is set to rainbow(N).

ewd

width of the edges, in pixels

etcol

color of the tiling edges, for the standard tiling of the facets by parallelograms. This only applies to facets that are not parallelograms. The default etol=NA means do not draw these edges.

fcol

A vector of colors to use when drawing the facets. The 1st color is used for parallelograms, the next color for hexagons, etc. For facets with more edges than colors available, the last color is used. If fcol is NULL, it is set to c( 'blue', 'red', 'yellow', 'green', 'orange', 'purple' ).

falpha

opacity of the facets

normals

if TRUE then draw an outward-pointing unit normal from each facet

bgcol

the background color

both

if FALSE then draw only one half of the centrally symmetric boundary. Otherwise draw both halves. This affects points, edges, and facets.

...

not used

Details

Points are drawn with rgl::points3d(). Edges are drawn with rgl::segments3d(). Edges of the tiles are drawn with rgl::quads3d(). Facets are drawn with rgl::quads3d(); facets with more than 4 edges are split into trapezoids. Facet normals are drawn with rgl::arrow3d().

Value

The function returns TRUE; or FALSE in case of error.

Note

The package rgl is required for 3D plots. A large black point is drawn at 0, a 50% gray point at the center, and a large white point at the "white point" (which is 2*center).

A line from the black point to the white point is also drawn.

See Also

zonohedron(), spherize.zonotope()


[Package zonohedra version 0.3-0 Index]