Skip to content

Provides a convenient way to test sphere packing with by defining inputs in JSON.

License

Notifications You must be signed in to change notification settings

aleph-oh/sphere_pack_from_json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sphere_pack_from_json

This repository uses the implementation of sphere packing in spherical-cow to parse descriptions of spheres provided as JSON objects, and provides the resulting packing density, surface area-to-volume ratio, and number of spheres packed.

Usage

As building the binaries from source would require cargo, it's easiest to use cargo install sphere_pack_from_json to build the binaries for your specific architecture. cargo install --git https://github.com/aleph-oh/sphere_pack_from_json.git can also be used to install from this repository instead.

The input format for files to be parsed is a JSON list of objects, where each object has a name property expressible as a String, a radius property expressible as a floating point value, and a proportion property (which is an integer) with a value between 0 and 255 inclusive.

The output format is also a JSON, with properties of volume fraction (expressed as a proportion, not a percentage), surface area to volume ratio, and sphere count.

TODO

More configurations, unit tests, criterion benchmarks (?)

About

Provides a convenient way to test sphere packing with by defining inputs in JSON.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages