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

Infinite loop when inserting more than leafLimit duplicate points #14

Open
andreabedini opened this issue Nov 11, 2020 · 1 comment
Open

Comments

@andreabedini
Copy link

Hi there,

thank you for the library. When I try to make an octree from my dataset of points, my program gets stuck and eventually runs out of memory.

After some troubleshoting, I came to the conclusion there is something wrong with the insertion logic. My dataset has many duplicate points in it, and at some point splitBy gets called with more than 16 identical points, at which point it starts looping.

He is a reproducible example:

import Linear.V3
import qualified Data.Octree as O

o = O.fromList $ replicate 17 (V3 1.0 2.0 3.0, ())

I understand the input is somehow patological but we need a way to handle it without crashing :-) I'll think some more about this tomorrow.

@andreabedini
Copy link
Author

I have put Octree aside now but the tl;dr is that splitBy' assumes it's always possible to split points while clearly this is not the case when we only have duplicate points. The fromList function seems to be the one in charge of deciding when to split, while perhaps it should be splitBy. Just my 2c.

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

1 participant