forum.alglib.net

ALGLIB forum
It is currently Thu Mar 28, 2024 7:01 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Nearest spheres search
PostPosted: Tue Oct 23, 2018 4:04 pm 
Offline

Joined: Tue Oct 23, 2018 3:15 pm
Posts: 2
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


Top
 Profile  
 
 Post subject: Re: Nearest spheres search
PostPosted: Wed Oct 24, 2018 3:49 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 903
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.


Top
 Profile  
 
 Post subject: Re: Nearest spheres search
PostPosted: Wed Oct 24, 2018 7:18 pm 
Offline

Joined: Tue Oct 23, 2018 3:15 pm
Posts: 2
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 51 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group