outline: Calculate outline

Description Usage Arguments Value Author(s) See Also Examples

View source: R/outline.R

Description

Calculate outline of a variable-width line, possibly without simplication.

Usage

1
2
3
4
5
6
7
outline(x, simplify=TRUE, ...)
## S3 method for class 'vwlineGrob'
outline(x, simplify=TRUE, ...) 
## S3 method for class 'offsetXsplineGrob'
outline(x, simplify=TRUE, ...) 
## S3 method for class 'offsetBezierGrob'
outline(x, simplify=TRUE, ...) 

Arguments

x

A variable-width line grob.

simplify

Whether to simplify the outline (using polyclip::polysimplify to collapse self-intersections).

...

Possible additional arguments for methods.

Value

A list with components x and y describing the complete outline of the variable-width line (possibly unsimplified).

Author(s)

Paul Murrell

See Also

grid.vwline, grid.offsetXspline grid.offsetBezier

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
grid.newpage()
x <- c(.2, .8, .8, .2)
y <- c(.2, .8, .2, .8)
w <- c(0, .1, .1, 0)
vwlg <- vwlineGrob(x, y, w, gp=gpar(col="grey", lwd=10, fill=NA))
grid.draw(vwlg)
o <- outline(vwlg, simplify=FALSE)
grid.polygon(o$x, o$y, default.units="in")

grid.newpage()
oxsg <- offsetXsplineGrob(x, y, w, gp=gpar(col="grey", lwd=10, fill=NA))
grid.draw(oxsg)
o <- outline(oxsg, simplify=FALSE)
grid.polygon(o$x, o$y, default.units="in")

vwline documentation built on July 25, 2019, 9:03 a.m.

Related to outline in vwline...