{"id":15650695,"url":"https://github.com/libbum/spherical-cow","last_synced_at":"2025-04-15T16:35:11.115Z","repository":{"id":54535515,"uuid":"117990685","full_name":"Libbum/spherical-cow","owner":"Libbum","description":"A high volume fraction sphere packing library","archived":false,"fork":false,"pushed_at":"2021-02-12T09:36:29.000Z","size":433,"stargazers_count":36,"open_issues_count":9,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T22:23:46.800Z","etag":null,"topics":["geometry","mathematics","rust-library","sphere-packing"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Libbum.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-18T14:05:02.000Z","updated_at":"2024-12-28T15:34:23.000Z","dependencies_parsed_at":"2022-08-13T19:00:47.383Z","dependency_job_id":null,"html_url":"https://github.com/Libbum/spherical-cow","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Libbum%2Fspherical-cow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Libbum%2Fspherical-cow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Libbum%2Fspherical-cow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Libbum%2Fspherical-cow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Libbum","download_url":"https://codeload.github.com/Libbum/spherical-cow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249109248,"owners_count":21214114,"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":["geometry","mathematics","rust-library","sphere-packing"],"created_at":"2024-10-03T12:35:31.316Z","updated_at":"2025-04-15T16:35:11.062Z","avatar_url":"https://github.com/Libbum.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eSpherical Cow\u003c/h1\u003e\n\n\u003cdiv align=\"center\"\u003eA high volume fraction sphere packing library\u003c/div\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://crates.io/crates/spherical-cow\"\u003e\n        \u003cimg src=\"https://img.shields.io/crates/v/spherical-cow.svg\" alt=\"Crates.io\" /\u003e\n    \u003c/a\u003e\n    │\n    \u003ca href=\"https://docs.rs/spherical-cow/\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/api-documentation-blue.svg\" alt=\"Docs.rs\" /\u003e\n    \u003c/a\u003e\n    │\n    \u003ca href=\"https://travis-ci.org/Libbum/spherical-cow\"\u003e\n        \u003cimg src=\"https://travis-ci.org/Libbum/spherical-cow.svg?branch=master\" alt=\"Travis-ci\" /\u003e\n    \u003c/a\u003e\n    │\n    \u003ca href=\"https://codecov.io/gh/Libbum/spherical-cow\"\u003e\n        \u003cimg src=\"https://codecov.io/gh/Libbum/spherical-cow/branch/master/graph/badge.svg\" alt=\"Codecov\" /\u003e\n    \u003c/a\u003e\n    │\n    \u003ca href=\"https://app.fossa.io/projects/git%2Bgithub.com%2FLibbum%2Fspherical-cow?ref=badge_shield\"\u003e\n        \u003cimg src=\"https://app.fossa.io/api/projects/git%2Bgithub.com%2FLibbum%2Fspherical-cow.svg?type=shield\" alt=\"FOSSA Status\" /\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\u003cbr /\u003e\n\nBased on the advancing fronts algorithm outlined in Valera *et al.*, [Computational Particle Mechanics 2, 161 (2015)](https://doi.org/10.1007/s40571-015-0045-8).\n\n\u003e Milk production at a dairy farm was low, so the farmer wrote to the local university, asking for help from academia.\n\u003e A multidisciplinary team of professors was assembled, headed by a theoretical physicist, and two weeks of intensive on-site investigation took place.\n\u003e The scholars then returned to the university, notebooks crammed with data, where the task of writing the report was left to the team leader.\n\u003e Shortly thereafter the physicist returned to the farm, saying to the farmer, \"I have the solution, but it works only in the case of spherical cows in a vacuum\".\n\n# Usage\n\nComplete documentation can be found at [docs.rs](https://docs.rs/spherical-cow/).\n\nA simple example to get you packing spheres of radii (0.1..0.2) into a container sphere of radius 2.\n```rust\nuse spherical_cow::shapes::Sphere;\nuse rand::distributions::Uniform;\nuse nalgebra::Point3;\n\nfn main() {\n    let boundary = Sphere::new(Point3::origin(), 2.0).unwrap();\n    let mut sizes = Uniform::new(0.1, 0.2);\n\n    let spheres = spherical_cow::pack_spheres(boundary, \u0026mut sizes).unwrap();\n\n    println!(\"Number of spheres: {}\", spheres.len());\n}\n```\n\nMore elaborate examples can be found in the [examples](examples/) directory.\n\n# Output\n\nTrue to its name, it is indeed possible to build a spherical cow:\n\n![spherical cow in vacuum](https://github.com/Libbum/spherical-cow/blob/master/examples/objects/cow_output.jpg?raw=true)\n\nYou can run this example yourself from [show_in_cow](examples/show_in_cow.rs).\n\n# Example use cases\n\nThe paper which this algorithm comes from gives two examples of real world use cases:\n\n1. Sphere packing a skull model to study fractures due to shocks and penetrating objects.\n2. Sphere packing a cutting tool to identify the failure / breaking points when the tool is placed under load.\n\nThe reason this library was initially written was to optimise the layout of inflatable [space habitats](https://github.com/Libbum/space-habitats) which may one day be constructed on the Moon and Mars.\n\n# License\n\nLicensed under the Apache License, [Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) or the [MIT license](http://opensource.org/licenses/MIT), at your option.\nThese files may not be copied, modified, or distributed except according to those terms.\n\n\n[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FLibbum%2Fspherical-cow.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FLibbum%2Fspherical-cow?ref=badge_large)\n\n\n## Deeply linked dependencies\n\nA large number of example files within this repository (but NOT distributed as part of this library) have GPL licensing obligations. Below is one example:\n\nThe [wayland-protocols](https://github.com/Smithay/wayland-rs/tree/master/wayland-protocols) library (released under an MIT license) is used by [kiss3d](https://github.com/sebcrozet/kiss3d) (used for visualisation previews in the examples).\nContent therein: the file `misc/server-decoration.xml`, is Copyright (C) 2015 Martin Gräßlin and licensed under the GNU Lesser General Public Library, version 2.1. You can find a copy of this license at [https://www.gnu.org/licenses/lgpl-2.1.en.html](https://www.gnu.org/licenses/lgpl-2.1.en.html)\n\nFor a complete list of these obligations, please refer to the license information from the associated crates. The Fossa links above can also assist.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibbum%2Fspherical-cow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibbum%2Fspherical-cow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibbum%2Fspherical-cow/lists"}