{"id":20828885,"url":"https://github.com/timothewt/tangramai","last_synced_at":"2025-04-15T14:24:01.082Z","repository":{"id":64430045,"uuid":"544911182","full_name":"timothewt/TangramAI","owner":"timothewt","description":"University project : Tangram puzzle solver","archived":false,"fork":false,"pushed_at":"2023-03-26T21:22:56.000Z","size":420,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T21:11:38.818Z","etag":null,"topics":["ai","backtracking","edge-matching","edge-matching-puzzles","open-cv","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timothewt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-03T12:59:49.000Z","updated_at":"2025-02-16T08:58:59.000Z","dependencies_parsed_at":"2025-01-18T18:38:31.041Z","dependency_job_id":"f55c0055-3586-4c39-b22e-3e16989518ed","html_url":"https://github.com/timothewt/TangramAI","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothewt%2FTangramAI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothewt%2FTangramAI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothewt%2FTangramAI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timothewt%2FTangramAI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timothewt","download_url":"https://codeload.github.com/timothewt/TangramAI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249086395,"owners_count":21210447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","backtracking","edge-matching","edge-matching-puzzles","open-cv","python"],"created_at":"2024-11-17T23:18:42.785Z","updated_at":"2025-04-15T14:24:01.054Z","avatar_url":"https://github.com/timothewt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eTangram AI\u003c/h1\u003e\n\n\n\u003cp align=\"center\"\u003e\n \u003cimg width=\"50%\" src=\"https://github.com/timothewt/TangramAI/blob/master/assets/introduction.png\" alt=\"Tangram Main Img\"\u003e\n\u003c/p\u003e\n\n\u003c!-- Table of Contents --\u003e\n# Table of Contents\n- [About the Project](#about-the-project)\n  * [Context](#context)\n  * [Made with](#made-with)\n  * [Features](#features)\n- [Getting Started](#getting-started)\n  * [Prerequisites](#prerequisites)\n  * [Installation](#installation)\n- [Usage](#usage)\n  * [Commands](#commands)\n  * [Use the editor](#use-the-editor)\n- [Examples](#examples)\n- [License](#license)\n- [Authors](#authors)\n\n# About the project\n \n ## Context\n This program is our final project for the IA41 class. We had as specifications to realize a tangram solver and to let the user realize his own puzzles.\n \n A tangram is a set of 7 geometric pieces (2 large triangles, 1 middle triangle, 1 parallelogram, 1 square and 2 small triangles). The goal is to complete an image where only the shadow of the pieces appears.\n \n ## Made with \n\n  This project has been made 100% in python.\n \n ## Features\n \n This program is able to solve mutliple tangrams puzzles in matters of seconds. It includes a built-in tangram editor allowing the user to create its own tangram puzzles and use the program to solve them. \n \n You can save the results of the execution of the program. This saved data includes the position of the solved piece on the 800x700px canvas, the execution time of the program and the differents steps to complete the tangram : \n \n\u003cp align=\"center\"\u003e\n \u003cimg width=\"100%\" src=\"https://github.com/timothewt/TangramAI/blob/master/assets/step_by_step.png\" alt=\"Step by step tangram solving\"\u003e\n\u003c/p\u003e\n \n \n# Getting Started \n\n ## Prerequisites\n \n In order to use the program you will need to have a python 3.X interpretor installed. \n The required libraries are listed in the [requirements.txt](https://github.com/timothewt/TangramAI/blob/master/requirements.txt) file. \n \n ## Installation \n \n 1. Clone the project and unzip it.\n 2. Install the librairies listed in [requirements.txt](https://github.com/timothewt/TangramAI/blob/master/requirements.txt)\n \n# Usage \n\n ## Commands\n \n  A simple use of the program to save the results of the solver is to execute this line in the terminal :\n  \n  ```console \n  py main.py --saveData True\n  ```\n  \n  The arguments available to use the program are : \n   - ```imagePath``` : Allow the user to use the solver on an prebuilt image (if no path is provided the program will use the built-in editor) \n   - ```saveData ```  : Allow the user to save the data of the execution in a .json file and the steps as .png files. (By default False) \n \n ## Use the editor\n This program includes a built-in editor that lets you design your own tangram puzzles. \n You can select the piece you want to use using the numbers keys :\n * \u003ckbd\u003e1\u003c/kbd\u003e Large triangle n°1 \n * \u003ckbd\u003e2\u003c/kbd\u003e Large triangle n°2\n * \u003ckbd\u003e3\u003c/kbd\u003e Medium Triangle\n * \u003ckbd\u003e4\u003c/kbd\u003e Parallelogram\n * \u003ckbd\u003e5\u003c/kbd\u003e Square\n * \u003ckbd\u003e6\u003c/kbd\u003e Small triangle n°1\n * \u003ckbd\u003e7\u003c/kbd\u003e Small triangle n°2\n \n When a piece is selected you can :\n  - Press \u003ckbd\u003eF\u003c/kbd\u003e to flip the active piece (useful when dealing with the parallelogram) \n  - Press \u003ckbd\u003eR\u003c/kbd\u003e to rotate the active piece\n  - Press \u003ckbd\u003eN\u003c/kbd\u003e to change the active piece's corner held by the mouse cursor\n \n# Examples\n\nTime (in seconds)  | 0.7 |  44.9 | 0.2 | 2586.5 |\n| :-: | ----------|----  | --- | --- |\n| **Solution steps** | \u003cimg src=\"https://github.com/timothewt/TangramAI/blob/master/assets/resolution_lapin.png\" alt=\"drawing\" width=\"200px\"/\u003e | \u003cimg src=\"https://github.com/timothewt/TangramAI/blob/master/assets/resolution_personne.png\" alt=\"drawing\" width=\"200px\"/\u003e | \u003cimg src=\"https://github.com/timothewt/TangramAI/blob/master/assets/resolution_chameau.png\" alt=\"drawing\" width=\"200px\"/\u003e |\u003cimg src=\"https://github.com/timothewt/TangramAI/blob/master/assets/resolution_maison.png\" alt=\"drawing\" width=\"200px\"/\u003e |\n\nWith our algorithm, most tangrams are solvable in only a few seconds. However, as shown here, some tangrams (usually those with few corners) are very difficult and the algorithm can spend a few tens of minutes.\n\n# License \n\nDistributed under the MIT License. \n\n# Authors\n\n- [@timothewt](https://github.com/timothewt)\n- [@HugoM25](https://github.com/HugoM25)\n\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothewt%2Ftangramai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimothewt%2Ftangramai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimothewt%2Ftangramai/lists"}