My end goal is to create an application where the user can load in a 3D mesh and then define a box. The app then try to fit as much mesh as possible into that box.

I figure that would be a pretty difficult problem, so I start small first. Let's say I have an arbitrary simple polygons with arbitrary orientation, how would I figure out how many polygons (and of course, how) I can fit within a bounded boundary (a rectangle for example)?

I dig around and the answer always point down to the Dancing Links algorithm that people used to solve Sudoku. But I fail to understand what is the link between that algorithm and the problem I'm trying to solve. Can someone give me a more verbose answer?