# NOT RUN {
#This is a 1x4 yellow brick
brick <- data.frame(
x = 1:4,
y = 1, z=1,
color = "Bright yellow",
stringsAsFactors=FALSE)
brick %>%
bricks_from_coords() %>%
build_bricks()
rgl::clear3d()
#This is a lot of bricks
bricks <- expand.grid(
x = 1:4,
y = 1:2,
z = 1:3)
#Color them in sets of these 3 options
bricks$color <- rep(rep(c("Bright yellow", "Bright red", "Tr. green"), each=4), 2)
# }
# NOT RUN {
bricks %>%
bricks_from_coords() %>%
build_bricks()
rgl::clear3d()
# }
# NOT RUN {
#Use different brick shapes by added a 'piece_type' column
bricks$piece_type <- "c1" #Make all the pieces cylinders
# }
# NOT RUN {
bricks %>%
bricks_from_coords() %>%
build_bricks()
rgl::clear3d()
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab