Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with return -1 #5

Open
vortexmethods opened this issue Jan 16, 2024 · 1 comment
Open

Problem with return -1 #5

vortexmethods opened this issue Jan 16, 2024 · 1 comment

Comments

@vortexmethods
Copy link

Can you let me know if the problem with "return -1" have been solved or not?

It is observed at searching the closest line segments for set of points (after slight modifcation of your code - 2D case and all necessary functions are implemented for aabb construction for line segments and distance from point to line segment calculation).

Maybe you can describe the source of the problem?

@ToruNiina
Copy link
Owner

I have forgotten almost everything about that issue (I think you mean #1). It is over 4 years ago.
But the issue is closed as completed with a commit, so it should have been fixed at that time.

At least, it seems that the function returns -1 if it cannot find anything in the tree at a glance. The commit (28d7344) linked to #1 changes the range, so possibly it fixes the range of search .

So, the possible causes could be: 1) the bvh was not constructed, 2) you have nothing in the tree, 3) wrong AABB distance calculation, 4) some bug in query_device(bvh, query_nearest) which implements Nick Roussopoulos, Stephen Kelley, Frederic Vincent, "Nearest Neighbor Queries", ACM-SIGMOD (1995). You may find differences between the paper and the implementation (https://github.com/ToruNiina/lbvh/blob/master/lbvh/query.cuh#L80).

If you met an error in your case and environment, please describe your problem in detail with a concrete, reproducible example. Otherwise, I will not be able to find a problem or check if it has been fixed.

Note that, since I don't have much time these days, I may not be able to find the time to fix it. It should take a long time because I would have to start from recalling what the problem was and what I did. But if you send a PullReq, I will review it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants