Skip to content

Calculate for given image (base64) the necessary bricks to build 3D figure and mosaic image.

License

Notifications You must be signed in to change notification settings

bitnulleins/lego-bricks-finder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is Bricksfinder?

Algorithm that calculate the optimial amount and size of LEGO bricks to build a 3D figure or mosaic image with lego bricks.

  • Calculate optimal brick amount
  • Prefere bigger size for lower cost
  • Calculate price, weight and size of finished figure
  • Transform true color to LEGO bricks color

Online service

A full service of this algorithm (with frontend) can be bound here (German).

Installation

  1. Fill out config.php
  2. Import SQL to MySQL with init_install.sql
  3. Call main function with base64 coded image:
<?php
require(__DIR__ . '/src/bricksfinder.class.php');

$bricksfinder = new Bricksfinder(B64_STRING_HERE);
$bricksfinder->getBricks(); // return array of bricks configuration

Result

For example 3D figure of "Megaman":

Input:

Megaman small gif

(Builded) Output:

Licence

MIT Licence

About

Calculate for given image (base64) the necessary bricks to build 3D figure and mosaic image.

Topics

Resources

License

Stars

Watchers

Forks