This function combines two sets of coordinates using one of the following operations: intersection, union, minus, and xor.
polyclip(A, B, ...)
# S3 method for grob
polyclip(A, B, op="intersection", closed=TRUE,
reduceA = if (closed) "union" else "flatten",
reduceB = "union",
fillA = NULL, fillB = NULL,
...)
# S3 method for gList
polyclip(A, B, op="intersection", closed=TRUE,
reduceA = if (closed) "union" else "flatten",
reduceB = "union",
fillA = NULL, fillB = NULL,
...)
# S3 method for gPath
polyclip(A, B, op="intersection", closed=TRUE,
strict=FALSE, grep=FALSE, global=FALSE,
reduceA = if (closed) "union" else "flatten",
reduceB = "union",
fillA = NULL, fillB = NULL,
...)
# S3 method for character
polyclip(A, B, op="intersection", closed=TRUE,
strict=FALSE, grep=FALSE, global=FALSE,
reduceA = if (closed) "union" else "flatten",
reduceB = "union",
fillA = NULL, fillB = NULL,
...)The result is a new set of coordinates.
A set of coordinates describing the subject shape. Or a grob, gList, or a gPath (or a character value) identifying a grob that has already been drawn from which coordinates are generated.
A set of coordinates describing the clip shape. Or a grob, gList, or a gPath (or a character value) identifying a grob that has already been drawn from which coordinates are generated.
A character value describing the operation. One of
"intersection", "minus", "union", or
"xor".
A logical value indicating whether the A coordinates describe
a closed shape or an open shape.
A character value describing the operation to be used if either
A or B need to be reduced to a single set of
coordinates. One of
"intersection", "minus", "union", or
"xor", in which case polyclip is used to
reduce multiple shapes, or "flatten", in which case
coordinates for all shapes are returned.
A character value describing the fill rule. Possible values are
"winding" or "evenodd" or NULL.
In the latter case (the default), the fill rule will be taken
from the coordinates if the coordinates have a "rule"
attribute. Otherwise, the default is "winding".
Arguments controlling the interpretation of the gPath
(passed to grid.get).
Arguments used by methods.
Paul Murrell
The subject coordinates are combined with the clip coordinates
using the op operation.
polyclip
r <- rectGrob(x=1/3, y=1/3, width=.4, height=.4)
c <- circleGrob(x=2/3, y=2/3, r=.2)
polyclip(r, c)
Run the code above in your browser using DataLab