[sarcasm]
I'm sorry, but your formal specification of that complex problem is too long.
Can you summarise it please.
[/sarcasm]
What do you expect, to randomly rotate shapes around a defined area, until the maximum number of shapes can fit ?
The permutations of position, rotation, size and shape would probably be too great. Also, you'd need to write a generic polygon collision detection algorithm.
If you can't even define your problem, then I seriously doubt that you are capable of solving it.
> What do you expect, to randomly rotate shapes around
> a defined area, until the maximum number of shapes
> can fit ?
Exactly
this is some example of the final result that i need (found with google):
http://www.delmac.com/images/software-nesting-jetshape.jpg
http://www.shopdata.com/images/parts_ind_auto_shape.gif
I can't find the right approach to the problem...
Okay, here's a wild idea, just because the problem has captured my imagination.
You could turn the whole problem into a sort of game of tetris.
When you scan in the shapes, you could pixelate them into oversized pixels blocks.Eg. a triangle might become 3 blocky pixels.
Then start "dropping" the nicest fitting shapes into the box.
When "dropping" the shapes you'll need accurate polygon collision detection.
If this is just a college project, then it should do.
If it's a commercial project, then you may need a more robust solution.
You might randomize the dropping of the shapes a little, and play N games, to work out which one "scored" the most.ie. had the most blocks packed into the defined space. That will be the most efficient packing.
regards,
Owen