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
>> narrow down which it is.
> Looks like the kd-tree is not always returning the nearest mesh vertex
> 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
> added some code to find the nearest vertex by using a brute-force check
> 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
Post a reply to this message