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
guess.
Post a reply to this message
Attachments:
Download 'test_compare.png' (252 KB)
Preview of image 'test_compare.png'
|