fill_shape: Draw a Filled-In Shape

Description Usage Arguments Value See Also Examples

View source: R/8-Draw.R

Description

Calculate the path of a shape given supplied vertices and draw to screen.

Usage

1
fill_shape(mat, cycle = TRUE, n = 30, text = "x", ...)

Arguments

mat

an Nx2 matrix of (row, col) coordinates

cycle

logical value determining whether to the first and last coordinates

n

number of points along each edge to calculate

text

character value drawn at coordinate

...

parameters that are passed to style(), including the foreground color fg, background color bg, and attribute attr

Value

NULL

See Also

Other drawing functions: box_at(), draw_arc(), draw_bezier(), draw_circle(), draw_ellipse(), draw_fn(), draw_lerp(), draw_path(), draw_ray(), draw_rect(), draw_shape(), fill_circle(), fill_ellipse(), fill_rect(), grid_at(), grid_mat(), hline_at(), hline(), vline_at(), vline()

Examples

1
2
3
4
5
6
# Right Triangle
fill_shape(rbind(
  c(10,1),
  c(10,10),
  c(1,1)
), cycle=TRUE)

cursr documentation built on Jan. 13, 2021, 7:35 a.m.