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

iTwin Reality Data integration #12334

Merged
merged 13 commits into from
Nov 26, 2024
Merged

iTwin Reality Data integration #12334

merged 13 commits into from
Nov 26, 2024

Conversation

jjspace
Copy link
Contributor

@jjspace jjspace commented Nov 25, 2024

Description

This PR is building off of #12289 to add an easy function to load Reality Data meshes. Currently we are only supporting 3D Tiles meshes and pointcloud types of Reality Data to keep the initial integration simple. More can be added in the future but they will require different datasources and constructors in CesiumJS and will require a little more thought on how to design the API.

Issue number and link

No issue

Testing plan

  • Running the test sandcastle
    • Load the new sandcastle and make sure it loads.
    • Check that the reality mesh in that iTwin loads and shows in the surrounding area.

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

Copy link

Thank you for the pull request, @jjspace!

✅ We can confirm we have a CLA on file for you.

@jjspace
Copy link
Contributor Author

jjspace commented Nov 25, 2024

@ggetz I know we discussed it this morning but can you do a quick pass on the API here just to confirm it looks good? then I'll start adding tests.

Base automatically changed from itwin-integration to main November 25, 2024 18:31
Copy link
Contributor

@ggetz ggetz left a comment

Choose a reason for hiding this comment

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

Overall API looks good @jjspace! Just a few comments.

packages/engine/Source/Core/ITwinPlatform.js Outdated Show resolved Hide resolved
packages/engine/Source/Core/ITwinPlatform.js Outdated Show resolved Hide resolved
packages/engine/Source/Scene/ITwinData.js Outdated Show resolved Hide resolved
packages/engine/Source/Scene/ITwinData.js Outdated Show resolved Hide resolved
packages/engine/Source/Scene/ITwinData.js Show resolved Hide resolved
@jjspace
Copy link
Contributor Author

jjspace commented Nov 25, 2024

@ggetz I've added tests now and I think addressed all your comments above. Should be ready for another look and I think it's close to done if not already there

Copy link
Contributor

@ggetz ggetz left a comment

Choose a reason for hiding this comment

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

This is looking good @jjspace!

I noticed that the reality mesh looks a bit blurry at the default settings. I was getting a comparable visual to other photogrammetry tilesets after setting the max SSE to 4

realityMesh.maximumScreenSpaceError = 4;

I'm guessing this may be because the geometric error of the tileset is balanced against the iTwin viewer, what may have different tile selection metrics. Have you seen the same for other Reality Data meshes?

What do you think of passing a default of 4 for all with the type of RealityMesh3DTiles?

packages/engine/Source/Scene/ITwinData.js Show resolved Hide resolved
@jjspace
Copy link
Contributor Author

jjspace commented Nov 26, 2024

@ggetz I agree the tileset in the sandcastle was too low quality by default. I check some other reality meshes I have access to and sse of 4 looked better on all of them too so I just set it as the default as you suggested.

Copy link
Contributor

@ggetz ggetz 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 fantastic, thanks @jjspace!

@ggetz ggetz added this pull request to the merge queue Nov 26, 2024
Merged via the queue into main with commit 31fdab5 Nov 26, 2024
5 checks passed
@ggetz ggetz deleted the itwin-reality-data branch November 26, 2024 17:12
@aruniverse
Copy link

fyi @matmarchand

iTwinId,
realityDataId,
type,
rootDocument,

Choose a reason for hiding this comment

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

I believe type and rootDocument should be extracted from the reality data metadata to ensure that they are consistent with what actually exist in the storage container... or maybe this is our way to avoid a call to get metadata since they were already extracted and assumed consistent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

or maybe this is our way to avoid a call to get metadata since they were already extracted and assumed consistent?

@matmarchand You are correct. If either of these values is missing we will fetch the metadata needed to load the tileset. This will likely only the rootDocument commonly but we grab and update both from the new request anyway.

However if the application using this function already has these values we can skip that network call. This could happen if the app loads the list of reality data using return=representation instead of return=minimal. Or if the app already called the individual metadata route themselves. No need to waste extra time and bandwidth if the info is already accessible

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

Successfully merging this pull request may close these issues.

4 participants