build_pieces: Display bricks required to build model or mosaic

View source: R/piece-count.R

build_piecesR Documentation

Display bricks required to build model or mosaic

Description

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

Usage

build_pieces(brick_obj)

Arguments

brick_obj

brickr mosaic or 3D model object.

Value

Plot object of required bricks by color and size.

See Also

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

Examples

# 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 draw piece chart
 
  mosaic %>% 
   build_pieces()
 

ryantimpe/brickr documentation built on Jan. 15, 2024, 10:29 p.m.