Special request

 From:  Michael Gibson
6097.10 
I guess from a programming point of view it would be better to set up a kind of marker of the "allowed region", like a bitmap with a white background with allowed areas marked in black. (probably by drawing triangles from a file prepared as Brian shows above). That would then simplify the collision detection part since it's easier to look at colored pixels than it is to do numerous curve intersections.

Then with that "allowed area" bitmap prepared the mechanism would go something like this:

Generate a random x,y coordinate within the bitmap for the center of a proposed circle. If the proposed center is not on an allowed area skip this one and try again.

Scan a square of pixels surrounding the center point keeping track of the closest non-allowed pixel that was found.

The circle radius then becomes some fraction (for padding) of that closest non-allowed pixel distance.

The circle is recorded, and then the bitmap is filled with white around the just placed circle so that it is off limits for the next placed ones.


Something along those lines anyway.. Unfortunately those steps need a lot of things like bitmap manipulation that are not set up currently for scripts to access easily. So you're talking about a pretty tremendously complex script that would do things like read a triangle OBJ file and render the triangles into a bitmap all with custom script code...


EDIT: Oops I missed Brian's first reply above, he mentions a similar thing as what I'm describing here.


- Michael

EDITED: 6 Aug 2013 by MICHAEL GIBSON