Giter Club home page Giter Club logo

lego-imagegenerator's Introduction

README

LET’S PLAY LEGO!

Project Description Our project is to generate a LEGO .ldr file through an input image, to describe and show how to assemble the LEGO bricks to imitate the image.

Code Structure Our project code is basically under the lego-solver project which contains a lot of modules performing distinct functions. For our solver, the code is under the directory of “/solvers”, but utilizing other modules’ functions especially being based on the “brick_modeling”, which provides fundamental operators and transformations as well as modeling methods.

List of File Types File types listed below are needed in our project: * .ldr - generated by lego studio, provides a placement of LEGO bricks. * .pkl - Python dict dumped file, gives the information of a connected graph. * .mzn - Minizinc solver instruction file, describes conditional constraints. * .col - need to be downloaded from the lego studio website, describes the features of a specific LEGO brick.

Main Code Structure gen_sketch_placement.py constructs the potential placement graph for the solver to select from. The potential placement graph is generated from the brick we pre-selected by their ids.

adjacency_graph.py converts potential placement graph into an undirected graph where there are two kinds of edges: collision edge and connection edge. The output graph will be dumped into a .pkl file.

get_sketch.py benefits from the last step, parsing the .pkl file and inject parameters to the mini zinc solver, in order to find an optimal solution. The output of the procedure is a .ldr file which can be visualized by lego studio or our main.py under the directory lego-solver.

Todo List - [ ] Currently we found out that the color layering is fully manual. This is because when we pass the parameters of the adjacency graph into the solver and get the solution, the node can’t be mapped back, which means we don’t the original color of a particular node. So we divide the image into regions based on different colors. ::This can be improved if we can map the nodes from the solution set to those of the potential node set.::

- [ ] Besides the problem described above, we also figured out that the maximum object is tricky and trivial, somewhat greedy. ::Our next step is about to add some parameters to control this maximum formula. By comparing different performance among different parameters, the solution can be more optimal.::

lego-imagegenerator's People

Contributors

anthony102899 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.