Hi everyone. I need some help with searching neighbours to each single point in the a point cloud. (like nearpoints in vex)
I'm using findAllCloseIdx for GEO_PointTree and it all works perfectly fine.
Now I'm trying to limit number of found points to n. Like vex nearpoints(0,@P,dist,max_pt);
findAllCloseIdx returns an array with all found point indices. If I simply cap that array it does the trick but performance vise it's pointless since findAllCloseIdx is the heaviest operation here.
So I tried to measure performance between my dll and point wrangle and searching for neapoints without limit gives ma a good performance vs pointwrangle.
But once I limit amount of points to search for then pointwragnle runs twice faster.
findAllCloseIdx doesn't take max points as argument so it searches for all the points within the radius.
What would be the optimization technique here ?
Thank you.
UPD: There is findAllCloseIdxQueue that according to different resources supposed to speed up lookup but I can't fingure out how to use ut_KDPQueue.
/// This allows you to create a search queue so you can maintain
/// it over time, avoiding the cost of reallocing for each search.
/// NOTE THAT max_distance_squared IS SQUARED DISTANCE.
static ut_KDPQueuePtr createQueue();
private:
riend class ut_KDPQueueDeleter;
static void destroyQueue(ut_KDPQueue *q);