-1

I have a finite set P of several thousands of sparse points in the 3d space and a moving sphere S of fixed radius. For every given moment t I know S_t, i.e. the volume of space occupied by the sphere. I don't know beforehand in which direction S is going to move next. How can I find the subset Q_t of all the points contained in S_t?

I thought to do as follows:

  1. Put all the points in an R-tree and compute Q_0
  2. For every t > 0, compute the relative complements

    N_t = S_t \ S_(t-1) and M_t = S_(t-1) \ S_t

  3. Then, I query the R-tree for all the points contained in the relative complements, P(N_t) and P(M_t)
  4. Finally, I update the result as:

    Q_t = Q_(t-1) + P(N_t) - P(M_t)

Does this work? Is there a more efficient way to compute this?

Also, are there any libraries that allow me to efficiently solve this?

Luigi D.
  • 165
  • 1
  • 10
  • is the sphere moving by some bounded increment? You might periodically find all points within some larger sphere (big enough to encompass the next `n` increments..), so reduce the search for a few subsequent increments. – agentp Nov 02 '17 at 21:11
  • 1
    What are **sparse** (?) points in 3d? Why can't you just query S_t every time? The complements yield a much more complex geometry than a sphere for querying. Also, efficiency will depend a lot on implementation quality of the search tree. – Has QUIT--Anony-Mousse Nov 03 '17 at 23:50
  • How many points inside the sphere do you expect ? This can make a big difference. –  Nov 04 '17 at 17:02

1 Answers1

0

I would store the points in a kD tree (k=3) and perform fixed-radius near-neighbor searches.

I am not sure that a strategy trying to exploit the small increments and solve for one position using the previous one(s) will really pay.