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

feat(potree): render all nodes #3162

Merged
merged 3 commits into from
Nov 25, 2024
Merged

Conversation

belom88
Copy link
Collaborator

@belom88 belom88 commented Nov 17, 2024

No description provided.

@belom88 belom88 requested a review from ibgreen November 17, 2024 16:53
Copy link
Collaborator

@ibgreen ibgreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. Fine to land.

Suggested a bunch of generalizations, they could come as a separate PR.

@@ -17,8 +17,8 @@
"@deck.gl/layers": "^9.0.32",
"@deck.gl/mesh-layers": "^9.0.32",
"@deck.gl/react": "^9.0.32",
"@loaders.gl/potree": "4.4.0-alpha.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion:

  • I'd probably rename this example from potree to point-tile-source with the goal of expanding it to cover COPCSource.
  • And perhaps we can even make point tile sources for 3D tiles and I3S?

@@ -1,5 +1,7 @@
import {Vector3} from '@math.gl/core';
import {DataSource} from '@loaders.gl/loader-utils';
import {POTreeNode} from '@loaders.gl/potree';
import {PotreeTraverser} from './potree-traverser';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • This idea of having a special traverser for each format always seemed wrong to me - i.e. I was hoping that we would not need to copy this particular pattern from the current TIleset3D code
  • The source should normalize the returned data so that a common traverser can handle the data.

@@ -45,7 +58,7 @@ export class PointcloudTileset {
}

get tiles() {
return [];
return this._selectedNodes;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: I would prefer that we don't overuse getters. There should be a good reason for using a getter. I.e.

  • Why use a getter here?
  • Why not just have a method getTiles()?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tileset.tiles is used by deck.gl

@@ -76,4 +76,54 @@ export class PotreeTile3DLayer<
}
});
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to rename this file/class to point-tile-source-layer?

@@ -0,0 +1,37 @@
import {POTreeNode} from "@loaders.gl/potree";

export class PotreeTraverser {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we must have a traverser class, can we generalize it a little bit: PointTileSourceTraverser?


if (result) {
let projection;
if (this.metadata?.projection) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would recommend defining helper methods for reprojection and bounding box calculations.

@belom88 belom88 marked this pull request as ready for review November 25, 2024 15:15
@belom88 belom88 merged commit ada9b94 into master Nov 25, 2024
1 check passed
@belom88 belom88 deleted the vb/feat-potree-render-all-nodes branch November 25, 2024 15:24
@ibgreen
Copy link
Collaborator

ibgreen commented Nov 25, 2024

@alekzvik This allows small point clouds to be rendered in an example (loads and renders all tiles).

Should provide a better starting point for integrating COPCSource.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants