tarnacious / 2d-packer

Coding with an inexperienced programmer to solve a packing problem.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2D Packing

After chatting about programming my flatmate wanted to know how you would solve a glass cutting problem with Programming.

We are doing it as two programs. The first takes a list of heights and widths and returns thier placement position, width and height.

$ echo "10 10
> 20 20" | python2 pack.py
0 0 20 20
20 0 10 10

The second draws the boxes.

$ cat rectangles.txt | python2 pack.py | python2 draw.py

screenshot

The problem we want to solve is a little more complex but this is a nice start.

About

Coding with an inexperienced programmer to solve a packing problem.


Languages

Language:Python 100.0%