Quote:
Originally posted by thecow
I have a few questions for you -
Could you limit the rectangles available to be entered?
How random do the positions need to be?
If you could give me an idea of what it is for, it would help - but I understand if you would rather not. If you want, I might give it a shot in PHP for free. The image drawing functions for PHP seem pretty simple, and that would make it web-based and os-independent. I really don't think it would be that hard if there is a decent limit on the rectangles inside (or the outer rectangle is a decent amount larger than the combined smaller rectangles).
|
Let's call a rectangle a "tile" and the area to fill a "polygon."
It's probably more effective to create a "library" of tiles such as:
Library 1: 10x10, 5x10, 20x20, etc.
Library 2: 10x10, 30x30, 30x15, etc.
The user would input library 2 and the app knows it has those sizes to work with. I think it's up to the application to determine the number of tiles that will fill the polygon.
The tile sizes need to be randomly chosen, not necessarily their location in the polygon.
My father-in-law is starting a business that sells stonework. He has various sized stones (ie: tiles). The stone might be laid into a walkway, a patio, etc. I'm calling the area a "polygon" for lack of a better term. He'd like the ability to select a group of tile sizes and have them randomly populate the polygon. This would be his design blueprint, graphically and a listing of tile sizes and how many of each are required.
Any tiles that spill over the polygon will be cut to fit, however the smaller tiles should probably be used to avoid waste.
If you need more information, send me a PM.
Thanks for your interest.