{"id":19973946,"url":"https://github.com/dcmox/binpacking","last_synced_at":"2026-06-24T17:31:30.252Z","repository":{"id":280170544,"uuid":"234234967","full_name":"dcmox/binpacking","owner":"dcmox","description":"Packing items in a 3D space","archived":false,"fork":false,"pushed_at":"2020-01-19T23:32:59.000Z","size":36,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-01T18:33:25.552Z","etag":null,"topics":["3d","algorithm","binpacking","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcmox.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":"2020-01-16T04:27:44.000Z","updated_at":"2023-08-22T13:26:19.000Z","dependencies_parsed_at":"2025-03-01T18:33:28.886Z","dependency_job_id":"06727a69-516e-423d-a28d-41b9205585d0","html_url":"https://github.com/dcmox/binpacking","commit_stats":null,"previous_names":["dcmox/binpacking"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dcmox/binpacking","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcmox%2Fbinpacking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcmox%2Fbinpacking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcmox%2Fbinpacking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcmox%2Fbinpacking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcmox","download_url":"https://codeload.github.com/dcmox/binpacking/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcmox%2Fbinpacking/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34743465,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["3d","algorithm","binpacking","typescript"],"created_at":"2024-11-13T03:13:27.161Z","updated_at":"2026-06-24T17:31:30.247Z","avatar_url":"https://github.com/dcmox.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# binpacking\nSimple binpacking algorithm for packing items in a 3D space.\n\n## Usage\n```typescript\nconst items: IBinItem[] = [\n    {length: 2, width: 2, height: 2, id: 'A'},\n    {length: 1, width: 2, height: 3, id: 'B'},\n    {length: 3, width: 1, height: 1, id: 'C'},\n    {length: 2, width: 2, height: 2, id: 'D'},\n    {length: 2, width: 4, height: 4, id: 'E'},\n    {length: 1, width: 5, height: 1, id: 'F'},\n    {length: 1, width: 2, height: 2, id: 'G'},\n    {length: 1, width: 1, height: 3, id: 'H'},\n    {length: 1, width: 3, height: 1, id: 'J'},\n    {length: 1, width: 1, height: 1, id: 'K'},\n    {length: 1, width: 3, height: 1, id: 'L'},\n    {length: 1, width: 1, height: 3, id: 'M'},\n    {length: 1, width: 1, height: 3, id: 'N'},\n    {length: 1, width: 3, height: 1, id: 'O'},\n    {length: 1, width: 2, height: 1, id: 'P'},\n    {length: 1, width: 1, height: 2, id: 'Q'},\n    {length: 2, width: 1, height: 1, id: 'R'},\n]\n\nconst bin = {width: 5, height: 5, length: 3}\n\nconsole.time('BinPack time')\nconst results = binpack(bin, items)\nconsole.log(results)\nconsole.timeEnd('BinPack time')\n```\n\n## Sample results\n```json\n{\n  \"box\": [\n    [\n      [\"E\", \"E\", \"E\", \"E\", \"F\"],\n      [\"E\", \"E\", \"E\", \"E\", \"F\"],\n      [\"E\", \"E\", \"E\", \"E\", \"F\"],\n      [\"E\", \"E\", \"E\", \"E\", \"F\"],\n      [\"J\", \"J\", \"J\", \"C\", \"F\"]\n    ],\n    [\n      [\"E\", \"E\", \"E\", \"E\", \"N\"],\n      [\"E\", \"E\", \"E\", \"E\", \"N\"],\n      [\"E\", \"E\", \"E\", \"E\", \"N\"],\n      [\"E\", \"E\", \"E\", \"E\", \"R\"],\n      [\"O\", \"O\", \"O\", \"C\", \"R\"]\n    ],\n    [\n      [\"B\", \"B\", \"G\", \"G\", \"M\"],\n      [\"B\", \"B\", \"G\", \"G\", \"M\"],\n      [\"B\", \"B\", \"K\", \"Q\", \"M\"],\n      [\"L\", \"L\", \"L\", \"Q\", \"P\"],\n      [\"H\", \"H\", \"H\", \"C\", \"P\"]\n    ]\n  ],\n  \"results\": [\n    {\n      \"order\": 1,\n      \"code\": \"SUCCESS\",\n      \"desc\": \"Orientation: Default\",\n      \"id\": \"E\",\n      \"success\": true\n    },\n    {\n      \"order\": 2,\n      \"code\": \"SUCCESS\",\n      \"desc\": \"Orientation: Default\",\n      \"id\": \"B\",\n      \"success\": true\n    },\n    {\n      \"order\": 3,\n      \"code\": \"ROTATION\",\n      \"desc\": \"Orientation: Rotate W -\u003e H\",\n      \"id\": \"F\",\n      \"success\": true\n    },\n    {\n      \"order\": 4,\n      \"code\": \"SUCCESS\",\n      \"desc\": \"Orientation: Default\",\n      \"id\": \"G\",\n      \"success\": true\n    },\n    {\n      \"order\": 5,\n      \"code\": \"SUCCESS\",\n      \"desc\": \"Orientation: Default\",\n      \"id\": \"J\",\n      \"success\": true\n    },\n    {\n      \"order\": 6,\n      \"code\": \"SUCCESS\",\n      \"desc\": \"Orientation: Default\",\n      \"id\": \"O\",\n      \"success\": true\n    },\n    {\n      \"order\": 7,\n      \"code\": \"SUCCESS\",\n      \"desc\": \"Orientation: Default\",\n      \"id\": \"N\",\n      \"success\": true\n    },\n    {\n      \"order\": 8,\n      \"code\": \"SUCCESS\",\n      \"desc\": \"Orientation: Default\",\n      \"id\": \"M\",\n      \"success\": true\n    },\n    {\n      \"order\": 9,\n      \"code\": \"SUCCESS\",\n      \"desc\": \"Orientation: Default\",\n      \"id\": \"L\",\n      \"success\": true\n    },\n    {\n      \"order\": 10,\n      \"code\": \"SUCCESS\",\n      \"desc\": \"Orientation: Default\",\n      \"id\": \"C\",\n      \"success\": true\n    },\n    {\n      \"order\": 11,\n      \"code\": \"ROTATION\",\n      \"desc\": \"Orientation: Rotate W -\u003e H\",\n      \"id\": \"H\",\n      \"success\": true\n    },\n    {\n      \"order\": 12,\n      \"code\": \"ROTATION\",\n      \"desc\": \"Orientation: Rotate H -\u003e L\",\n      \"id\": \"R\",\n      \"success\": true\n    },\n    {\n      \"order\": 13,\n      \"code\": \"SUCCESS\",\n      \"desc\": \"Orientation: Default\",\n      \"id\": \"Q\",\n      \"success\": true\n    },\n    {\n      \"order\": 14,\n      \"code\": \"ROTATION\",\n      \"desc\": \"Orientation: Rotate W -\u003e H\",\n      \"id\": \"P\",\n      \"success\": true\n    },\n    {\n      \"order\": 15,\n      \"code\": \"SUCCESS\",\n      \"desc\": \"Orientation: Default\",\n      \"id\": \"K\",\n      \"success\": true\n    },\n    {\n      \"order\": \"Unfit\",\n      \"code\": \"OVERSIZED\",\n      \"desc\": \"Item D can't fit: 2x2x2\",\n      \"id\": \"D\",\n      \"success\": false\n    },\n    {\n      \"order\": \"Unfit\",\n      \"code\": \"OVERSIZED\",\n      \"desc\": \"Item A can't fit: 2x2x2\",\n      \"id\": \"A\",\n      \"success\": false\n    }\n  ],\n  \"rotations\": 4,\n  \"unfit\": 2\n}\nBinPack time: 54.064ms\n```\n\n## TODO\nNeeds unit testing and 3D visualization of packing results.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcmox%2Fbinpacking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcmox%2Fbinpacking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcmox%2Fbinpacking/lists"}