How to distribute 5 dots evenly on an irregular shape?

Here is the problem I am trying to solve:

I have the wrong shape. How would I go to distribute 5 points evenly on this shape so that the distance between each point is equal to each other?

+2


source to share


4 answers


it is mathematically impossible. It will only work for a small subset of the basic shapes.

However, there are some solutions you can try:



  • An analytical approach. Start at point P0, create a sphere around P0 and intersect with the base shape, giving you a set of C0 curves. Then create another point P1 somewhere on C0. Create a sphere again around P1 and intersect with C0 giving you a set of points C1, your third point P2 will be one of the points in C1. Etc. This approach guarantees distance constraints, but it also strongly depends on the initial conditions.

  • An iterative approach. Essentially a search for forms. You are creating multiple objects on an object, and you are also creating sources between those that share the distance constraint. Then you decide the spring forces and move your points accordingly. This will most likely push them away from their base shape, so you need to bring them back to their base shape. Repeat until your points are no longer moving or until the distance limit is satisfied within tolerance.

  • Sample. Convert the base geometry to voxel space and start digging out any voxels that are too close to the recently inserted point. This will ensure that you never run into two points too close together, but also experience tolerance issues (and possibly performance).

If you can provide more information about the nature of your geometry and your constraints, a more specific answer will be possible.

+6


source


David says this is not possible, but there is actually an answer from the left margin: just put all your dots on top of each other ! They will all have the same distance to all other points: zero.

In fact, the only algorithm that has a solution (i.e. all pairwise distances are the same) regardless of the input shape.



I know the question asks the question "evenly", but since this is not formally defined, I expect this to be just an attempt to explain "all pairwise distances are the same", in which case my answer is "even".

+10


source


The only way to arrange 5 points equally spaced from each other (apart from the trivial solution to draw them through the origin) is in a 4+ dimension space. It is mathematically impossible to have 5 equally distant objects in 3D. Four is the maximum you can have in 3D, and this shape is a tetrahedron.

+1


source


For those who stumble here in the future, use Lloyd's algorithm .

enter image description here

+1


source







All Articles