Skip to content

Infinite loop when inserting more than leafLimit duplicate points #14

@andreabedini

Description

@andreabedini

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions