{"id":37045410,"url":"https://github.com/simulation-tree/bin-packer","last_synced_at":"2026-01-14T05:14:56.394Z","repository":{"id":297818458,"uuid":"833988913","full_name":"simulation-tree/bin-packer","owner":"simulation-tree","description":"Packing squares into bigger squares","archived":false,"fork":false,"pushed_at":"2025-09-24T03:03:17.000Z","size":50,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-24T05:21:19.692Z","etag":null,"topics":["bin-packing","csharp","dotnet"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simulation-tree.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-07-26T07:29:09.000Z","updated_at":"2025-09-24T03:00:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"57e25da7-df60-4b44-89db-704795c9d525","html_url":"https://github.com/simulation-tree/bin-packer","commit_stats":null,"previous_names":["simulation-tree/bin-packer"],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/simulation-tree/bin-packer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simulation-tree%2Fbin-packer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simulation-tree%2Fbin-packer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simulation-tree%2Fbin-packer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simulation-tree%2Fbin-packer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simulation-tree","download_url":"https://codeload.github.com/simulation-tree/bin-packer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simulation-tree%2Fbin-packer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28410356,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"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":["bin-packing","csharp","dotnet"],"created_at":"2026-01-14T05:14:55.816Z","updated_at":"2026-01-14T05:14:56.389Z","avatar_url":"https://github.com/simulation-tree.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bin Packing\n\nProvides a bin packing solving algorithm through the [rectpack2D](https://github.com/simulation-tree/rectpack2D) project.\n\n### Using\n\nThere two main methods to the packer, one requires you to know the size ahead of time,\nthe other finds it for you:\n```cs\nRecursivePacker packer = new();\nSpan\u003cVector2\u003e sizes = stackalloc Vector2[5];\nsizes[0] = new Vector2(32, 32);\nsizes[1] = new Vector2(32, 32);\nsizes[2] = new Vector2(32, 32);\nsizes[3] = new Vector2(32, 16);\nsizes[4] = new Vector2(32, 16);\nSpan\u003cVector2\u003e positions = stackalloc Vector2[5];\n\n//if you know the max size ahead of time:\nif (packer.TryPack(sizes, positions, new Vector2(64, 64), padding))\n{\n    //success\n}\nelse\n{\n    Assert.Fail(\"Failed to pack the boxes into the given size\");\n}\n\n//let the packer find the smallest size:\nVector2 maxSize = packer.Pack(sizes, positions, padding);\nAssert.That(maxSize, Is.EqualTo(new Vector2(64, 64)));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimulation-tree%2Fbin-packer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimulation-tree%2Fbin-packer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimulation-tree%2Fbin-packer/lists"}