Skip to contents

Draws one filled region made of several rings (outer pieces and holes) - the building block for filled contour / 2-D density bands. The whole region is filled with a single hole-aware scan-line (so holes stay empty), and every ring is stroked with a roughened outline. A "solid" fill paints the rings with an even-odd rule.

Usage

sketch_band_grob(
  rings,
  roughness = 0.7,
  bowing = 0.5,
  n_passes = 2L,
  seed = NULL,
  fill_style = "solid",
  hachure_angle = 45,
  hachure_gap = 0.05,
  fill_weight = 0.5,
  fill_roughness = NULL,
  fill_seed = NULL,
  fill_col = NA,
  outline_gp = gpar(),
  name = NULL,
  vp = NULL
)

Arguments

rings

A list of rings, each a list with npc [0,1] x and y vertex vectors. The even-odd arrangement of outer pieces and holes is honoured.

roughness, bowing, n_passes, seed

Sketch parameters for the outlines.

fill_style

"solid" (default), "hachure", "cross_hatch", or "watercolor" (hole-aware translucent washes).

hachure_angle, hachure_gap, fill_weight

Fill parameters (hachure_gap in device inches; NULL picks 15% of the region's smaller drawn extent, clamped to [0.04, 0.15] inches).

fill_roughness

Roughness of the fill strokes. NULL (default) ties it to the outline as roughness * 0.5.

fill_seed

Seed for the fill (hatching or washes). NULL (default) derives it from seed; set an integer to vary the fill pattern without moving the outline.

fill_col

Fill colour (NA leaves the region empty).

outline_gp

gpar() for the roughened ring outlines.

name, vp

Passed to grid::gTree().

Value

A SketchBandGrob grob subclass.