sl.plot.platon.init: Initialise Platon Plot

View source: R/sl.plot.platon.init.R

sl.plot.platon.initR Documentation

Initialise Platon Plot

Description

Initialise a Platonian-type body plot. Currently possible are hexahedrons (cubes) and icosahedrons. The plot is composed of faces arranged in a net that can be crafted into a 3-dimensional platonian-type body. Returns a list that needs to be provided to any spheRlab plotting functions called afterwards, ended by a call of sl.plot.platon.end.

Usage

sl.plot.platon.init(body.type = "hexahedron", width = 60, skip.faces = NULL, col.background = NULL, device = "pdf", do.init = TRUE, do.init.device = do.init, file.name = paste0("~/sl.plot.platon.",device), mar = rep(0,4))

Arguments

body.type

a character specifying the body type. Currently possible types are "hexahedron" (cube) and "icosahedron".

width

a scalar specifying the width of the resulting figure.

skip.faces

an integer (vector) specifying the index (or indices) of faces to omit from the plot. Can be used e.g. for plotting a colourbar and/or other descriptive information onto one or more of the faces. If skip.faces=NULL (default), all faces are drawn.

col.background

a background colour. Default is col.background=NULL, meaning that no background is drawn. Note that this parameter determines only the background colour of the map, for faces that are not skipped. To set the background colour of the whole plot, use par(bg=...) before calling sl.plot.platon.init.

device

a character specifying which graphics device to use. Default is device='pdf'. Ignored if do.init.device=FALSE.

do.init

a logical value indicating whether or not an initial call of plot shall be executed. Default is do.init=TRUE.

do.init.device

a logical value indicating whether or not initialise a device as specified by device. Default is do.init.device=do.init. If do.init.device=FALSE but do.init=TRUE, the plot will be initialised in the standard graphical device.

file.name

a character specifying the output file. Only used if do.init.device=TRUE. Default is file.name=paste0('~/sl.plot.platon.',device).

mar

a numerical vector of the form c(bottom, left, top, right) which gives the relative width of margin to be added to the four sides of the plot. This can be used to make space for a colourbar, for example. The default is rep(0,4).

Details

This projection type is a nice gimmick of spheRlab - and in fact part of the reason why rather sophisticated procedures are applied in spheRlab at the plot domain boundaries. For example, at the plot domain boundaries the visible parts of lines and polygons are explicitly computed and then drawn instead of plotting them completely and masking the unintended parts afterwards. The latter 'trick' would be much easier, but fails when separate plot parts are drawn right next to each other, as is the case for the platonian-type body nets!

Value

A list that must be provided to any spheRlab plotting functions called afterwards. In fact, the returned list contains N standard spheRlab plot specifics lists as the first N (unnamed) elements for the N faces that will be generated for the platonian-type body plot, plus the following list elements thereafter:

projection

the character "platon".

body.type

see the corresponding argument.

deltaxy

a scalar giving the length of the face edges in the projected x-y plane.

Note

If anyone wants to burn some spare time, how about adding the truncated icosahedron to the list of possible bodies? That would be so cool! :-)

Author(s)

Helge Goessling

See Also

sl.plot.init, sl.plot.platon.end

Examples

## To be provided ...

helgegoessling/spheRlab documentation built on April 8, 2024, 8:34 a.m.