Skip to contents

Adds a geometric shape to the scene.

Usage

add_shape(
  scene,
  shape_type = "rectangle",
  position = c(0, 0, 0),
  color = "#FFFFFF",
  fill_color = NULL,
  width = 1,
  height = 1,
  radius = 0.5,
  stroke_width = 2,
  fill_opacity = 0.5,
  opacity = 1
)

Arguments

scene

A Scene object

shape_type

Type of shape ("rectangle", "circle", "triangle", "polygon")

position

Center position

color

Stroke color

fill_color

Fill color (NULL for no fill)

width

Width (for rectangles)

height

Height (for rectangles)

radius

Radius (for circles)

stroke_width

Stroke width

fill_opacity

Fill opacity

opacity

Overall opacity

Value

The Scene object (invisibly) for piping

Examples

if (FALSE) { # \dontrun{
scene("shapes") %>%
  add_shape("circle", radius = 1, color = "blue", fill_color = "lightblue") %>%
  grow_from_center() %>%
  render()
} # }