Skip to contents

Compute or draw a rough multipath

Usage

rough_polypath(
  x,
  y = NULL,
  id = NULL,
  rule = c("winding", "evenodd"),
  hand = NULL
)

draw_rough_polypath(
  x,
  y = NULL,
  id = NULL,
  rule = c("winding", "evenodd"),
  hand = NULL,
  col = NA,
  border = graphics::par("fg"),
  fill_pattern = NULL,
  ...
)

Arguments

x, y

Coordinates as for graphics::polypath().

id

Optional path ids. Consecutive points with the same id belong to one closed ring.

rule

Fill rule, "winding" or "evenodd".

hand

Hand-drawn geometry settings created with hand().

col

Fill colour. When visible and fill_pattern is NULL, a solid fill is drawn.

border

Border colour.

fill_pattern

Optional fill pattern created with hatch(), crosshatch(), zigzag(), or jumble().

...

Graphics parameters passed to graphics::lines().

Value

A list with x, y, id, and rule components describing roughened closed rings.

Examples

plot(1:10, 1:10, type = "n")
draw_rough_polypath(c(2, 8, 8, 2, 4, 6, 6, 4),
                    c(2, 2, 8, 8, 4, 4, 6, 6),
                    id = c(rep(1, 4), rep(2, 4)),
                    rule = "evenodd",
                    hand = human_hand(),
                    col = "grey90",
                    fill_pattern = hatch(density = 9))