outline: Calculate outline

View source: R/outline.R

outlineR Documentation

Calculate outline

Description

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

Usage

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

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 Sept. 11, 2024, 7:56 p.m.

Related to outline in vwline...