Deviner Posted August 22, 2018 Share Posted August 22, 2018 Hello, I started learning hdk. I need to find a nearest point, what the best way to do this? I have an example code in attachments. But it doesn't work as expected. Thanks sandDunes.cpp sandDunes.h Quote Link to comment Share on other sites More sharing options...
MrScienceOfficer Posted August 22, 2018 Share Posted August 22, 2018 I don't think your point loop is formatted correctly.... C++ requires braces around loops with more then one line... GA_FOR_ALL_PTOFF and all similar variations are just macros around a for loop, I think you just need to add the braces. Quote Link to comment Share on other sites More sharing options...
Deviner Posted August 22, 2018 Author Share Posted August 22, 2018 2 hours ago, MrScienceOfficer said: I don't think your point loop is formatted correctly.... C++ requires braces around loops with more then one line... GA_FOR_ALL_PTOFF and all similar variations are just macros around a for loop, I think you just need to add the braces. thank you for a reply right, I'll check this Anyway, I'm not sure about the approach I'm using. Ideally, I need an array with some closest points Quote Link to comment Share on other sites More sharing options...
MrScienceOfficer Posted August 22, 2018 Share Posted August 22, 2018 I think it's probably the best approach. A KD-Tree, which is what GEO_PointTree is, is a good choice for nearest neighbor searches. If you look at the implementation of UT_KDTree(if im not mistaken) you should be able to find an appropriate query function for your needs. 1 Quote Link to comment Share on other sites More sharing options...
forever_kk Posted September 30, 2023 Share Posted September 30, 2023 GU_NeighbourList Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.