Skip to content

Commit

Permalink
feat: Rust/Webassembly octree implementation for faster point-object …
Browse files Browse the repository at this point in the history
…assignment (#2327)


Co-authored-by: Savelii Novikov <kvaka2000@gmail.com>
  • Loading branch information
haakonflatval-cognite and Savokr authored Sep 16, 2022
1 parent 0e754a9 commit 269dea0
Show file tree
Hide file tree
Showing 70 changed files with 2,918 additions and 815 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ viewer/public/
viewer/false
.eslintcache
__diff_output__/
viewer/wasm/pkg/*

# Examples

Expand Down
17 changes: 17 additions & 0 deletions examples/src/utils/PointCloudObjectStylingUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,27 @@ export class PointCloudObjectStylingUI {
const actions = {
reset: () => {
this._model.removeAllStyledObjectCollections();
},
randomColors: () => {
model.traverseStylableObjects((object) => {
const objectStyle: [number, number, number] = [
Math.floor(Math.random() * 255),
Math.floor(Math.random() * 255),
Math.floor(Math.random() * 255),
];

const stylableObject = new AnnotationIdPointCloudObjectCollection([
object.annotationId,
]);
model.assignStyledObjectCollection(stylableObject, {
color: objectStyle,
});
});
}
};

uiFolder.add(actions, 'reset').name('Reset all styled objects');
uiFolder.add(actions, 'randomColors').name('Set random for objects');
}

private createObjectAppearanceUi(uiFolder: dat.GUI): () => PointCloudAppearance {
Expand Down
830 changes: 818 additions & 12 deletions examples/yarn.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion viewer/.eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
dist/*
packages/**/wasm/pkg/*
target/*
target/*
Loading

0 comments on commit 269dea0

Please sign in to comment.