S
S
satahippy2014-06-02 14:49:47
JavaScript
satahippy, 2014-06-02 14:49:47

How to randomly place objects in a plane?

Task: randomly place objects in a plane (space), so that they do not intersect.
Objects of various sizes. tell me how it can be done? Are there any algorithms?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrew, 2014-06-02
@satahippy

If you have a risk that due to the high density of filling it is a problem to fit all the objects, then this is a "3D bin packing problem". The task is NP-complete, there are many materials on its solutions - mostly heuristics.
There are loads of ideas here .
After tight packing (when the first part of the "put everything" problem is solved) you can "pull" the objects randomly to make them random.

M
Mikhail Alekseev, 2014-06-02
@Fandorin

It is possible, roughly speaking, to inscribe these objects in a square (cube) and thus place, check the intersections of such objects simply.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question