

Of course, this will slow things down / add complexity / increase the memory requirements of the algorithm. Then, when you test points in step (3) and you find that there is already a point in an adjacent cube, check the distance to that point before you decide whether to throw the point away. One way is to add the coordinates of the point to the flags. It it is a problem, however, this limitation can be overcome. The algorithm will throw away too many points because it uses cubes instead of spheres.

If you still have unprocessed points, go to 3.If none of the adjacent cubes are flagged with a point of that color, flag the cube with the color of the point like in (2). For the next point, see which cube is in.Add a flag to the cube that contains the point to indicate that that cube contains a point of that color. For the first point, see which cube it is in.The the length of the side of each cube should be half the minimum distance between points. Divide the space into a regular lattice of cubes.Knowing the name of an algorithm of this type would be immensely helpful. I just don't want this to happen very often, and I cannot accept points that are to close not being detected.Īlso, I'm sure there is a family of algorithms devoted to this, but I can't for the life of me come up with any names. That is, I am fine if points get "detected" even if they are not too close. I am also fine with a trigger-happy solution. For instance, if an exact "collision radius" represents a perfect sphere, then I would be fine with the collision radius being the shape of, say, a cube.

I would like to remove as few colors as possible, however, this is not mandatory I could simply remove all colors that are involved in any collisions AT ALL, though, it could result in a lower quality result. My end goal, is to remove all points with the same color, until there are no more collisions. Are within a certain (general) distance of each other, and.Every point has a random color (represented by an integer, for example) 50k points randomly allocated in 3D space, according to some volumetric function, so that in some parts of the space, points are closer together, but in other parts, they are further away.
