nannernest
Optimal peanut butter and banana sandwiches
nannernest: optimal banana placement on sandwiches
A small package that works out how to cover a slice of bread with banana, given a top down photo, using a nesting library with C dependencies that complicate installation.
The problem
The repository is a small package for optimizing banana coverage on peanut butter and banana sandwiches. That is the entire brief. The README positions it as a light weight tool for a specific, playful problem rather than a general purpose library, and links a blog post for more information. The package is written in Python, and the problem it solves is oddly specific, which the project leans into.
Installation
The package is generally pip installable, but the README recommends a specific approach because of C dependencies. The nesting library used, called nest2D, has C dependencies, and there is an outstanding pull request that complicates a plain install. The recommended path is to make sure boost and cmake are installed first. On Linux, cmake may already be present, and boost can be installed separately. The steps stay short: install the system packages, then install the package itself.
How you use it
Usage is image based. Take a top-down picture that contains the banana and at least one slice of bread, then pass the image in via the command line. The package computes an arrangement that optimizes banana coverage on the bread. The workflow means the user only needs a photo and a command line call to run the optimization. There is no GUI and no configuration beyond the image itself, which keeps the tool small.
Editorial conclusion
The whole thing is a light weight answer to a very specific problem: a picture of a banana and bread in, an optimized arrangement out. A blog post covers the details.
Community notes