{"id":13579566,"url":"https://github.com/enzoruiz/3dbinpacking","last_synced_at":"2025-04-05T23:31:48.239Z","repository":{"id":41168879,"uuid":"177436874","full_name":"enzoruiz/3dbinpacking","owner":"enzoruiz","description":"A python library for 3D Bin Packing","archived":false,"fork":false,"pushed_at":"2023-12-14T05:24:00.000Z","size":604,"stargazers_count":370,"open_issues_count":26,"forks_count":91,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-03-08T06:35:42.146Z","etag":null,"topics":["3d-bin-packing","bin-packing","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/enzoruiz.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}},"created_at":"2019-03-24T16:00:28.000Z","updated_at":"2025-03-05T01:54:28.000Z","dependencies_parsed_at":"2024-04-08T16:58:53.361Z","dependency_job_id":"dec8854c-6181-4eeb-b296-97abef846e2f","html_url":"https://github.com/enzoruiz/3dbinpacking","commit_stats":{"total_commits":20,"total_committers":4,"mean_commits":5.0,"dds":0.5,"last_synced_commit":"e8c6e6ecfd79574eeae126fad498351790fbd5bf"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enzoruiz%2F3dbinpacking","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enzoruiz%2F3dbinpacking/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enzoruiz%2F3dbinpacking/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enzoruiz%2F3dbinpacking/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enzoruiz","download_url":"https://codeload.github.com/enzoruiz/3dbinpacking/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247415783,"owners_count":20935383,"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":["3d-bin-packing","bin-packing","python"],"created_at":"2024-08-01T15:01:40.634Z","updated_at":"2025-04-05T23:31:43.230Z","avatar_url":"https://github.com/enzoruiz.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"3D Bin Packing\n====\n\n3D Bin Packing implementation based on [this paper](erick_dube_507-034.pdf). The code is based on [gedex](https://github.com/gedex/bp3d) implementation in Go.\n\n## Features\n1. Sorting Bins and Items:\n    ```[bigger_first=False/True]``` By default all the bins and items are sorted from the smallest to the biggest, also it can be vice versa, to make the packing in such ordering.\n2. Item Distribution:\n    - ```[distribute_items=True]``` From a list of bins and items, put the items in the bins that at least one item be in one bin that can be fitted. That is, distribute all the items in all the bins so that they can be contained.\n    - ```[distribute_items=False]``` From a list of bins and items, try to put all the items in each bin and in the end it show per bin all the items that was fitted and the items that was not.\n3. Number of decimals:\n    ```[number_of_decimals=X]``` Define the limits of decimals of the inputs and the outputs. By default is 3.\n\n## Install\n\n```\npip install py3dbp\n```\n\n## Basic Explanation\n\nBin and Items have the same creation params:\n```\nmy_bin = Bin(name, width, height, depth, max_weight)\nmy_item = Item(name, width, height, depth, weight)\n```\nPacker have three main functions:\n```\npacker = Packer()           # PACKER DEFINITION\n\npacker.add_bin(my_bin)      # ADDING BINS TO PACKER\npacker.add_item(my_item)    # ADDING ITEMS TO PACKER\n\npacker.pack()               # PACKING - by default (bigger_first=False, distribute_items=False, number_of_decimals=3)\n```\n\nAfter packing:\n```\npacker.bins                 # GET ALL BINS OF PACKER\nmy_bin.items                # GET ALL FITTED ITEMS IN EACH BIN\nmy_bin.unfitted_items       # GET ALL UNFITTED ITEMS IN EACH BIN\n```\n\n\n## Usage\n\n```\nfrom py3dbp import Packer, Bin, Item\n\npacker = Packer()\n\npacker.add_bin(Bin('small-envelope', 11.5, 6.125, 0.25, 10))\npacker.add_bin(Bin('large-envelope', 15.0, 12.0, 0.75, 15))\npacker.add_bin(Bin('small-box', 8.625, 5.375, 1.625, 70.0))\npacker.add_bin(Bin('medium-box', 11.0, 8.5, 5.5, 70.0))\npacker.add_bin(Bin('medium-2-box', 13.625, 11.875, 3.375, 70.0))\npacker.add_bin(Bin('large-box', 12.0, 12.0, 5.5, 70.0))\npacker.add_bin(Bin('large-2-box', 23.6875, 11.75, 3.0, 70.0))\n\npacker.add_item(Item('50g [powder 1]', 3.9370, 1.9685, 1.9685, 1))\npacker.add_item(Item('50g [powder 2]', 3.9370, 1.9685, 1.9685, 2))\npacker.add_item(Item('50g [powder 3]', 3.9370, 1.9685, 1.9685, 3))\npacker.add_item(Item('250g [powder 4]', 7.8740, 3.9370, 1.9685, 4))\npacker.add_item(Item('250g [powder 5]', 7.8740, 3.9370, 1.9685, 5))\npacker.add_item(Item('250g [powder 6]', 7.8740, 3.9370, 1.9685, 6))\npacker.add_item(Item('250g [powder 7]', 7.8740, 3.9370, 1.9685, 7))\npacker.add_item(Item('250g [powder 8]', 7.8740, 3.9370, 1.9685, 8))\npacker.add_item(Item('250g [powder 9]', 7.8740, 3.9370, 1.9685, 9))\n\npacker.pack()\n\nfor b in packer.bins:\n    print(\":::::::::::\", b.string())\n\n    print(\"FITTED ITEMS:\")\n    for item in b.items:\n        print(\"====\u003e \", item.string())\n\n    print(\"UNFITTED ITEMS:\")\n    for item in b.unfitted_items:\n        print(\"====\u003e \", item.string())\n\n    print(\"***************************************************\")\n    print(\"***************************************************\")\n\n```\n\n## Latest Stable Version\n    py3dbp==1.1.2\n\n## Versioning\n- **1.x**\n    - Two ways to distribute items (all items in all bins - all items in each bin).\n    - Get per bin the fitted and unfitted items.\n    - Set the limit of decimals of inputs and outputs.\n- **0.x**\n    - Try to put all items in the first bin that can fit at least one.\n\n## Credit\n\n* https://github.com/bom-d-van/binpacking\n* https://github.com/gedex/bp3d\n* [Optimizing three-dimensional bin packing through simulation](erick_dube_507-034.pdf)\n\n## License\n\n[MIT](./LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenzoruiz%2F3dbinpacking","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenzoruiz%2F3dbinpacking","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenzoruiz%2F3dbinpacking/lists"}