Skip to content

[Octree] Properly remove invalid points from nodes.#99

Closed
grishavanika wants to merge 1 commit into
mosra:masterfrom
grishavanika:master
Closed

[Octree] Properly remove invalid points from nodes.#99
grishavanika wants to merge 1 commit into
mosra:masterfrom
grishavanika:master

Conversation

@grishavanika
Copy link
Copy Markdown
Contributor

Hello.

Was looking at Octree example and I think I got it right.
In removeInvalidPointsFromNodes(), line 294 - last element we swap with can also be invalid and, as result, skipped.
Without this change, after call to incrementalUpdate() there are points duplicates.

I simply put remove_if. Hope that makes sense.
On my PC, release build, without vsync, this improves CPU perf 2x with default options.

Last element we swap with can also be invalid and, as result, skipped.
@grishavanika grishavanika changed the title Properly remove invalid points from nodes. [Octree] Properly remove invalid points from nodes. Sep 16, 2021
@mosra mosra added this to the 2020.0b milestone Oct 17, 2021
@mosra
Copy link
Copy Markdown
Owner

mosra commented Oct 17, 2021

Hi!

Sorry for an extremely late reply -- was busy elsewhere. This indeed seems like a bug, thanks for catching and fixing it!

Looking at the code, the root cause seems to be the lack of arrayRemove() APIs in the library, which is why the buggy swap-remove code was added in the first place. I'll postpone the fix until arbitrary array insertion and removal implemented in Corrade, that should make the code cleaner overall.

Thanks again!

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants