Learn R Programming

ggsketch (version 2.0.0)

engrave_fill: Fill a region with tonal engraving (line density follows a tone field)

Description

The engraving counterpart of hachure_fill_multi(): instead of one uniform hatch, it lays down a engrave_ladder() of hatch layers and keeps each layer only where the field tone reaches that layer's threshold, so line density (and cross-hatching) tracks the tone continuously across the region. Holes are handled exactly as in hachure_fill_multi() (shared even-odd scan-line).

Usage

engrave_fill(
  rings,
  field,
  ladder = NULL,
  roughness = 0.5,
  bowing = 0,
  sample_step = NULL,
  seed = NULL,
  ...
)

Value

A list of 2-column (x, y) stroke matrices (same structure as hachure_fill_multi()), densest where the field is darkest.

Arguments

rings

A list of rings, each list(x, y) of vertex coordinates in inch/data space (see hachure_fill_multi()).

field

A vectorised tone function function(x, y) returning a value in [0, 1] per point (0 = lightest/paper, 1 = darkest/solid).

ladder

A hatch ladder from engrave_ladder(); if NULL, a default ladder is built from ....

roughness, bowing

Sketch params applied to each surviving stroke. Defaults 0.5 and 0.

sample_step

Tone-sampling step along each scan line (inches). NULL (default) uses a fraction of the finest ladder pitch.

seed

Integer seed.

...

Passed to engrave_ladder() when ladder is NULL.

See Also

Other sketch-core: arrowhead(), curve_fill(), engrave_ladder(), hachure_fill(), hachure_fill_multi(), leader_path(), repel_layout(), rough_arc(), rough_bezier(), rough_ellipse(), roughen_polyline(), sketch_arrowheads(), sketch_fill(), sketch_fill_multi(), spray_scatter(), stroke_profile(), stroke_ribbon(), treemap_layout(), wash_bleed(), watercolor_wash(), watercolor_wash_multi()