Skip to contents

Draws one or more annular sectors (pie or donut slices) sharing a centre, guaranteed circular regardless of panel shape: radii are taken as a fraction of the smaller panel dimension and the geometry is assembled in device inches inside makeContent(), then roughened. Each slice's roughened boundary is also reused as the fill region so the hand-drawn edge is kept.

Usage

sketch_wedge_grob(
  x0,
  y0,
  r,
  r0 = 0,
  start,
  end,
  roughness = 1,
  bowing = 0.4,
  n_passes = 2L,
  seed = NULL,
  fill_style = "solid",
  hachure_angle = 45,
  hachure_gap = NULL,
  fill_weight = 0.5,
  fill_roughness = NULL,
  fill_seed = NULL,
  fill_gp = gpar(),
  outline_gp = gpar(),
  name = NULL,
  vp = NULL
)

Arguments

x0, y0

Centre in npc [0,1] (scalars).

r, r0

Outer and inner radius as a fraction of the smaller panel dimension (r0 = 0 gives a pie, r0 > 0 a donut).

start, end

Per-slice start/end angles in radians.

roughness, bowing, n_passes, seed

Sketch parameters for the outline.

fill_style

"solid" (default) paints each slice in its fill colour; any other style ("hachure", ...) hatches it instead.

hachure_angle, hachure_gap, fill_weight

Fill parameters (hachure_gap is a fraction of the smaller panel dimension; NULL, the default, picks 15% of each slice's smaller drawn extent in device inches, clamped to [0.04, 0.15] inches).

fill_roughness

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

fill_seed

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

fill_gp

gpar() for the fill (per-slice col recycled).

outline_gp

gpar() for the rough outline (per-slice col recycled).

name, vp

Passed to grid::gTree().

Value

A SketchWedgeGrob grob subclass.