grid.minkowski: Generate Minkowski Sums of Grobs

View source: R/minkowski.R

grid.minkowskiR Documentation

Generate Minkowski Sums of Grobs

Description

Given a polygonal pattern and a polygonal path, generate the Minkowski Sum by adding the pattern to the path.

Usage

minkowskiGrob(A, B, 
              grobFn=xyListToPath,
              name=NULL, gp=gpar(), ...) 
grid.minkowski(A, B, ...)

Arguments

A

A grob, gList, or gTree, or a gPath or a character value identifying a grob that has already been drawn. This is known as the pattern grob.

B

A grob, gList, or gTree, or a gPath or a character value identifying a grob that has already been drawn. This is known as the path grob.

grobFn

The function that is used to create the final grob result. Predefined options are: xyListToPath, xyListToPolygon, and xyListToLine.

name

A name for the resulting grob.

gp

Graphical parameter settings for the resulting grob.

...

For minkowskiGrob, arguments passed on to polyclip::polyminkowski.

Details

Both A and B should not contain self-intersections, though they can be non-convex.

Value

minkowskiGrob returns a gTree.

grid.minkowski is only used for its side-effect of drawing on the current graphics device.

Author(s)

Jack Wong

See Also

xyListToPath, xyListToPolygon, xyListToLine, polyminkowski

Examples

pattern <- circleGrob(x = 0, y = 0, r = .1)
path <- rectGrob(width = 0.5, height = 0.5)
minkowski <- minkowskiGrob(pattern, path)
grid.draw(minkowski)

gridGeometry documentation built on Sept. 11, 2024, 8:41 p.m.