Description Usage Arguments Value See Also Examples
Convert a data frame with x, y, z & Color columns into a 3D object
1 2 3 4 5 6 7 8 9 10 11 12 13 |
coord_table |
A data frame of a 3D brick model design. Contains 'x', 'y', and 'z' (vertical height) dimensions, as well as 'Color' from official LEGO color names.
See |
use_bricks |
Array of brick sizes to use in mosaic. Defaults to |
increment_level |
Default '0'. Use in animations. Shift Level/z dimension by an integer. |
min_level |
Default '1'. Use in animations. Any Level/z values below this value will be cut off. |
max_level |
Default 'Inf'. Use in animations. Any Level/z values above this value will be cut off. |
increment_x |
Default '0'. Use in animations. Shift x dimension by an integer. |
max_x |
Default 'Inf'. Use in animations. Any x values above this value will be cut off. |
increment_y |
Default '0'. Use in animations. Shift y dimension by an integer. |
max_y |
Default 'Inf'. Use in animations. Any y values above this value will be cut off. |
exclude_color |
Numeric array of color ID numbers to exclude. |
exclude_level |
Numeric array of Level/z dimensions to exclude. |
A list with elements Img_lego
to pass to build_bricks
.
Other 3D Models:
bricks_from_excel()
,
bricks_from_mosaic()
,
bricks_from_table()
,
build_bricks()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | #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)
bricks %>%
bricks_from_coords() %>%
build_bricks()
rgl::clear3d()
#Use different brick shapes by added a 'piece_type' column
bricks$piece_type <- "c1" #Make all the pieces cylinders
bricks %>%
bricks_from_coords() %>%
build_bricks()
rgl::clear3d()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.