There are a few similar questions on stackoverflow, but none of them seem to provide a tangible answer that someone without a solid understanding of NP-hard problems and algorithms can understand.
How does one perform 2D bin packing of rectangular objects? In my case, I'm trying to assemble several images into a single image, for use as a spritesheet, using the smallest amount of space. Each image possibly has wildly different bounds, but there is no set bounds to the container.
I was hoping someone with an understanding of bin packing algorithms could explain how this can be achieved programmatically, rather than providing a general overview of the bin packing method.
question from:
https://stackoverflow.com/questions/8762569/how-is-2d-bin-packing-achieved-programmatically 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…