问题
Is there a standard for this? Algorithm name?
Say: I have 10 polygons of different sizes. I have an area of specific size.
I want to know how to fill the most polygons in that area, and how they are fitted.
Note: Polygons may be rotated depending on the restriction set.
回答1:
One possible name is a Packing Problem. It is related to the Knapsack Problem. These problems tend to be NP-hard, and many require heuristics. If you can constrain the allowed forms of polygons and of the area, there may exist a more efficient algorithm for your special case.
回答2:
You can have a look at "Dancing Links" in Wikipedia for Donald Knuth's solution to the exact cover problem - which includes tiling - your question can be looked at as a tiling problem
回答3:
IF (that's a big if) all your polygons were rectangles, and the area into which they are to fit is also a rectangle, then this would be called bin-packing, Google will overwhelm you with information about this. If they're not then I guess that you are looking for a variant of bin-packing, and I guess some more that you are into an NP problem for which 'try and test' is about the best algorithm around.
来源:https://stackoverflow.com/questions/1824711/algorithm-for-fitting-2d-polygons-in-an-area