POV-Ray : Newsgroups : povray.general : Minimum Distance Function : Re: Minimum Distance Function Server Time
15 Aug 2022 09:05:21 EDT (-0400)
  Re: Minimum Distance Function  
From: jceddy
Date: 12 Jul 2022 16:10:00
Message: <web.62cdd4626fb4e448864166f75d51d79c@news.povray.org>
Well, I think I have decided that doing nearest-vertex calculation using a
kd-tree is *not* the best way to implement this for meshes.

I've attached a file comparing my original simulated-annealing run (using a very
short simulated annealing period after a very short brute force), which does
simple ray sampling, to the version that does a nearest-neighbor vertex search
on the mesh data using a kd-tree, and then finds the nearest point on any
triangles using that vertex.

The upper image is the simulated annealing one, and the lower image is the
nearest-neighbor mesh one. You can see that the simulated annealing approach
results in better output.

*ALSO*, the simulated annealing approach runs more quickly...it completed in
less than 60% of the time of the other one.

I think I am going to put those code changes on the back-burner, after making
sure I store them away somewhere, and then go ahead with another option I was
thinking about: doing a simple gradient descent search from an initial candidate

Post a reply to this message

Download 'test_compare.png' (252 KB)

Preview of image 'test_compare.png'


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