forum.alglib.net
http://forum.alglib.net/

Nearest spheres search
http://forum.alglib.net/viewtopic.php?f=2&t=3869
Page 1 of 1

Author:  Pafnuty [ Tue Oct 23, 2018 4:04 pm ]
Post subject:  Nearest spheres search

Can I find the N nearest spheres of different radii?

For example, can I use the kdtreequeryaknn function for this?

How should I determine Eps in this case?

Image

Author:  Sergey.Bochkanov [ Wed Oct 24, 2018 3:49 pm ]
Post subject:  Re: Nearest spheres search

Hi!

Approximate k-nn search is used to speed-up high-dimensional queries. In your case you need exact search algorithm.

Unfortunately, kd-trees do not support queries exactly like yours (it is inherent limitation of the entire approach, not ALGLIB limitation). If radii of the spheres are limited by some upper bound, you can store sphere centers (not sizes) in kd-tree and use distance-based query (a sequence of queries with increasing distances) to select set of nearest neighbors which will need further filtering.

Author:  Pafnuty [ Wed Oct 24, 2018 7:18 pm ]
Post subject:  Re: Nearest spheres search

Hello Sergey,

I apologize, seems I formulated the task not entirely correctly.

The regular search algorithm will not work, since I need the nearest surface of the sphere, not the nearest center of the sphere.

For example, if I need only 5 nearest spheres, then there is no chance for the red sphere to get into the search results, even if I specify a search number 5 times greater. This is despite the fact that the red sphere is the nearest!

Image

But you suggested to me a good idea. I will try to create several kd-trees, separately for large, medium and small spheres. Hope this works.

But I heard that there are search algorithms for rendering that are just looking for triangles nearest to the camera. Perhaps this is what I need.

Maybe you know similar algorithms, and where to find them?


Anyway, thanks for the reply.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/