Skip to contents

Convenience function to add a rectangle to the scene.

Usage

add_rectangle(
  scene,
  width = 2,
  height = 1,
  position = c(0, 0, 0),
  color = "#FFFFFF",
  fill_color = NULL,
  stroke_width = 2,
  fill_opacity = 0.5
)

Arguments

scene

A Scene object

width

Rectangle width

height

Rectangle height

position

Center position

color

Stroke color

fill_color

Fill color

stroke_width

Stroke width

fill_opacity

Fill opacity

Value

The Scene object (invisibly) for piping

Examples

if (FALSE) { # \dontrun{
scene("rect_demo") %>%
  add_rectangle(width = 4, height = 2, fill_color = "green") %>%
  grow_from_center() %>%
  render()
} # }