build_pieces_table: Generate required bricks as a data frame

Description Usage Arguments Value See Also Examples

View source: R/piece-count.R

Description

Create a dataframe of brick colors and sizes used in a brick mosaic or model.

Usage

1
build_pieces_table(brick_obj)

Arguments

brick_obj

brickr mosaic or 3D model object.

Value

Data frame of piece counts by LEGO color name and size.

See Also

Other Resources: build_colors(), build_instructions(), build_pieces()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Import a jpeg or png
 demo_file <- system.file("extdata", "demo_img.jpg", 
                          package = "brickr", mustWork = TRUE)
 demo_image <- jpeg::readJPEG(demo_file)
#Create a mosaic oject 
 
 mosaic <- demo_image %>% 
   image_to_mosaic(img_size = 24)
 
 
 #Rather than drawing the mosaic, use build_pieces_table() to produce piece table
 
  mosaic %>% 
   build_pieces_table()
 

brickr documentation built on Aug. 3, 2020, 1:07 a.m.