js: Expose reorderPoints and simplifyPoints #622
Merged
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.
Similarly to
reorderMesh
,reorderPoints
can improve spatial locality ofpoint clouds, which results in improved compression ratio when using
attribute encoder, and may also improve rendering performance by
improving rasterization locality. On some point cloud data sets this improves
compression ratio by 1.5x-2x.
Similarly to
simplify
,simplifyPoints
can reduce the number of renderedpoints while attempting to preserve appearance.
simplifyPoints
optionallysupports per-point color; unlike triangle mesh simplification,
simplifyPoints
is currently guaranteed to reach the requested target because points have
no topology that can restrict simplification, and the function doesn't accept
an error bound.
color_weight
can be used to adjust the importance of RGBcolor relative to position; the recommended value is
1e-2
.reorderPoints
is based on an algorithm that has been used without changesfor a few years so it can probably be marked as stable; however,
simplifyPoints
might need to be marked as experimental (just like
simplifyWithAttributes
),as it may need future interface/implementation corrections.
We currently don't have a great way to mark JS APIs as experimental; this is
something to explore in a separate PR (but before release).