On Wed, 6 May 2009, Zhichu Chen wrote:
To Aditya: Clearly I over-emphasized the randomness. Actually, what I meant is a little more complex: identical objects on random coordinates and they don't intersect with each other. We can rotate them but we can't re-size them and scale them.
The difficult part in this case is recognizing that either the input is infeasible (you cannnot put 100 circles of radius 1 in a 10x10 square), or that a particular random sample is stuck and you need to restart.
Your code is very interesting. I'll see what I can do now.
Both Taco's and my solutions can be adapted so that you do not randomize the radius. (Taco's solution will also work for arbitrary object that can then be rotated by a random amount).
Another option that you can consider (if you only want the result to look random), is to start with a uniform placement on a grid and then move objects around by a small amount randomly. This will give an appearance that they are placed at random.
Aditya ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________