POV-Ray : Newsgroups : povray.general : Minimum Distance Function : Re: Minimum Distance Function Server Time
8 Aug 2022 22:40:37 EDT (-0400)
  Re: Minimum Distance Function  
From: Jérôme M. Berger
Date: 13 Jul 2022 12:18:25
Message: <62cef051@news.povray.org>
On 7/13/22 3:28 PM, jceddy wrote:
>> Either there is a bug in my kd-tree implementation, or there is someth
>> fundamentally incorrect with the approach. Will have to do some more t
esting to
>> narrow down which it is.
> Looks like the kd-tree is not always returning the nearest mesh vertex 
to the
> test point. I create a test that compares the minimum distance found us
> simulated annealing vs. the one found using the nearest-vertex test, an
d then
> added some code to find the nearest vertex by using a brute-force check
 of *all*
> the vertices in the mesh, which I run in the case the simulated-distanc
e found a
> better solution than the kd-tree nearest-vertex approach.
> I fairly quickly ran into a case where kd-tree is not returning the cor
> vertex, so now need to figure out why that is the case.
     There is something fundamentally wrong with your approach: the 
closest approach is not necessarily on a face that includes the closest 
vertex. If you look at the image I posted to p.b.i, when searching for 
the closest point to the cross in the bottom, the closest vertex is the 
red one, but the closest face is the orange one, which doesn't include 
the red vertex…


PS: Sorry I sent that to your email instead of the group.
mailto:jeb### [at] freefr
Diaspora*: https://framasphere.org/u/jeberger

Post a reply to this message

Copyright 2003-2021 Persistence of Vision Raytracer Pty. Ltd.