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

simplify: Rework point simplification to use reservoirs #618

Merged
merged 3 commits into from
Oct 12, 2023
Merged

Commits on Oct 10, 2023

  1. simplify: Compute and output maximum error in simplifyPoints

    This makes it easier to debug the underlying algorithm and metrics.
    zeux committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    990fbcb View commit details
    Browse the repository at this point in the history
  2. simplify: Fix quadricFromPoint math

    Before this, point simplifier encoded non-sensical functions into the
    quadric which resulted in fairly suboptimal candidate point selection,
    raising the effective error (when computed separately as a distance function)
    by ~2x.
    
    To make mistakes like this less likely in the future we now annotate
    each quadric structure with the formula it encodes.
    zeux committed Oct 10, 2023
    Configuration menu
    Copy the full SHA
    ffa5505 View commit details
    Browse the repository at this point in the history

Commits on Oct 11, 2023

  1. simplify: Replace point quadrics with reservoirs

    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.
    zeux committed Oct 11, 2023
    Configuration menu
    Copy the full SHA
    c59860b View commit details
    Browse the repository at this point in the history