{"id":19531399,"url":"https://github.com/ranpy13/floor-plan","last_synced_at":"2025-06-21T17:43:03.873Z","repository":{"id":242261372,"uuid":"809105616","full_name":"ranpy13/floor-plan","owner":"ranpy13","description":"Converts 3D images to floor plans","archived":false,"fork":false,"pushed_at":"2024-06-01T17:55:50.000Z","size":8,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-29T06:22:39.885Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ranpy13.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-06-01T17:44:36.000Z","updated_at":"2025-02-23T09:15:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"ab91a667-8372-4793-877c-b5f40ef5b475","html_url":"https://github.com/ranpy13/floor-plan","commit_stats":null,"previous_names":["ranpy13/floor-plan"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranpy13%2Ffloor-plan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranpy13%2Ffloor-plan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranpy13%2Ffloor-plan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranpy13%2Ffloor-plan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ranpy13","download_url":"https://codeload.github.com/ranpy13/floor-plan/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249508722,"owners_count":21283456,"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":[],"created_at":"2024-11-11T01:42:44.219Z","updated_at":"2025-04-18T14:58:46.185Z","avatar_url":"https://github.com/ranpy13.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# floor-plan\n\u003e _Converts 3D images to floor plans using simple python tools, openCV and contour detection_\n---\n\n### Procedure\n\n* Load the 3D `.obj` file: Use the `trimesh` library to load the 3D model.\n* Project the 3D model onto a 2D plane: Convert the 3D vertices to 2D coordinates.\n* Render the 2D projection: Create an image from the 2D projection.\n* Edge detection: Use OpenCV's Canny edge detection.\n* Find and draw contours: Use OpenCV's findContours and drawContours to create the floor plan.\n\n\n### Explanation:\n\n1. **Loading the 3D `.obj` file**: The `trimesh` library is used to load the 3D model and extract its vertices and faces.\n2. **Projection to 2D**: The 3D vertices are projected onto the 2D plane by taking the XY coordinates. The vertices are normalized to fit into a 1000x1000 pixel image for better visualization.\n3. **Drawing the 2D projection**: The edges of the 2D projection are drawn onto a blank canvas using OpenCV’s `line` function.\n4. **Edge detection**: Canny edge detection is applied to the 2D projection.\n5. **Finding and drawing contours**: The contours are found and drawn to create the floor plan. The resulting image is saved and displayed.\n\n### Dependencies:\n- `trimesh`: For loading and handling the 3D `.obj` file.\n- `numpy`: For numerical operations.\n- `opencv-python`: For image processing.\n\nYou can install the required libraries using pip:\n```bash\npip install trimesh numpy opencv-python\n```\n\n### Next Steps:\n**a.** Add additional preprocessing steps, like filtering out small contours, to improve the floor plan's accuracy.\n\n**b.** Integrate a GUI to allow users to select the `.obj` file and visualize the floor plan interactively.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Franpy13%2Ffloor-plan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Franpy13%2Ffloor-plan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Franpy13%2Ffloor-plan/lists"}