Dinamic position of shape

How can I position different shape on sheet to reduce the free space (nesting shape)?
[92 byte] By [SuperErika] at [2007-9-25]
# 1
So you basically want Java to be able to solve a sort of vague jigsaw puzzle ?
omcgoverna at 2007-7-15 > top of java,Security,Cryptography...
# 2
I need to reduce at the minimun the discard of paper
SuperErika at 2007-7-15 > top of java,Security,Cryptography...
# 3

[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.

omcgoverna at 2007-7-15 > top of java,Security,Cryptography...
# 4

> 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...

SuperErika at 2007-7-15 > top of java,Security,Cryptography...
# 5

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

omcgoverna at 2007-7-15 > top of java,Security,Cryptography...