simplify: Rework point simplification to use reservoirs #618
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While quadrics are very important for triangle mesh simplification, they
are decidedly overkill for point cloud simplification. We encode a
simpler function into them compared to triangles, and even that function
is too complicated for what we need - minimizing the sum of square
distances to all points in the cell ends up yielding approximately the
same result as averaging all points in the cell and minimizing the
distance to that average.
The benefit of a simpler formulation is that there's less memory used
for encoding the function and less computation required to aggregate the
points / minimize the error.
This also sets us up for including color error into the calculation (by
computing a weighted average of the colors and minimizing the 6D
distance to XYZ+RGB). Even once we include RGB into the reservoirs,
we'll be at 7 floats per cell, vs 11 floats per cell that we spend right
now for weighted quadrics.
The RGB support is planned for a future PR; for now this improves the
error (due to a bug fix in quadric math, which is approximately equivalent
to reservoir based code) and makes space for extra data and calculation
for color support.