I posted this question a while ago but unfortunately I’ve been unable to solve it with the answers provided. Also, I’ve had a look on Stack Overflow for similar questions but they’re way over my head. So apologies for creating a new thread, but I’m hoping for some more suggestions.

Basically, I want to randomly generate a bunch of non-intersecting cylinders of varying size within a circle, much like an Ishihara colour test:

Colour is unimportant, I just need to be able to define the minimum distance between each circle. Any help is much appreciated.

Here’s my code so far:

```
public Transform circle;
public int numberOfCircles;
public int circleSize;
void Start()
{
for (int i = 0; i < numberOfCircles; i++)
{
circleSize = Random.Range(1, 4);
circle.localScale = new Vector3(1 * circleSize, 1, 1 * circleSize);
Vector2 pos = Random.insideUnitCircle * 10;
Vector3 newPos = new Vector3(pos.x, 0, pos.y);
Instantiate(circle, newPos, Quaternion.identity);
}
}
```

And here’s an example result, with 25 circles.:

[21534-screen+shot+2014-02-02+at+5.20.13+pm.png|21534]

As you can see, there’s a lot of intersecting, and the circles don’t really form the shape of a larger one.

I suppose I could just instantiate a hundred or so circles then destroy them until there is none intersecting, but I’m sure there is a more elegant solution.