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

fix: point cloud custom transformation #2550

Conversation

haakonflatval-cognite
Copy link
Contributor

@haakonflatval-cognite haakonflatval-cognite commented Oct 10, 2022

Description

Point clouds were not translated properly and had their bounding boxes translated wrongly when a custom transformation was applied to them. This fixes that issue, and makes sure that stylable bounding boxes also receive the appropriate transformation when traversed by the user.

A fundamental mistake in the previous code, is that it uses updateMatrix on the model, which computes the local matrix from scale, position and rotation, overwriting the matrix we just set. (See https://threejs.org/docs/#manual/en/introduction/Matrix-transformations)

Checklist:

Here is a checklist that should completed before merging this given feature.
Any shortcomings from the items below should be explained and detailed within the contents of this PR.

  • I am proud of this feature.
  • I have performed a self-review of my own code.
  • I have manually tested this for different scenarios (different models, formats, devices, browsers).
  • I have commented my code in hard-to-understand areas.
  • I have made corresponding changes to the public documentation.
  • I have added unit and visuals tests to prove that my feature works to the best of my ability.
  • I have refactored the code for readability to the best of my ability.
  • I have checked that my changes do not introduce regressions in the public documentation.
  • I have outlined any known defects / lacking capabilities in the contents of this PR.
  • I have listed any remaining work that should follow this PR in the description or jira/miro/etc.
  • I have added TSDoc to any public facing changes.
  • I have added "developer documentation" in any package README.md that is related / applicable to this PR.
  • I have noted down and am currently tracking any technical debt introduced in this PR.
  • I have thoroughly thought about the architecture of this implementation.
  • I have asked peers to test this feature.

@haakonflatval-cognite haakonflatval-cognite added the slack PRs and issues with this label will be pushed to Slack label Oct 10, 2022
@haakonflatval-cognite haakonflatval-cognite requested a review from a team as a code owner October 10, 2022 12:09
@github-actions
Copy link

There were failures in the visual tests workflow.
Image diffs for visual tests can be downloaded as an artifact here.

@github-actions
Copy link

There were failures in the visual tests workflow.
Image diffs for visual tests can be downloaded as an artifact here.

@codecov
Copy link

codecov bot commented Oct 10, 2022

Codecov Report

Merging #2550 (f45e8d1) into feat/point-cloud-styling (d765a15) will decrease coverage by 2.03%.
The diff coverage is n/a.

@@                     Coverage Diff                      @@
##           feat/point-cloud-styling    #2550      +/-   ##
============================================================
- Coverage                     70.37%   68.34%   -2.04%     
============================================================
  Files                           271      239      -32     
  Lines                         11072     9716    -1356     
  Branches                       1405     1274     -131     
============================================================
- Hits                           7792     6640    -1152     
+ Misses                         3123     2918     -205     
- Partials                        157      158       +1     
Impacted Files Coverage Δ
...s/cad-geometry-loaders/src/sector/culling/types.ts 62.50% <0.00%> (-37.50%) ⬇️
...cad-parsers/src/utilities/float32BufferToMatrix.ts 0.00% <0.00%> (-25.00%) ⬇️
...wer/packages/pointclouds/src/PotreeGroupWrapper.ts 64.21% <0.00%> (-9.75%) ⬇️
viewer/packages/utilities/src/counterMap.ts 92.85% <0.00%> (-7.15%) ⬇️
...ng/src/pipeline-executors/BasicPipelineExecutor.ts 94.00% <0.00%> (-6.00%) ⬇️
...wer/packages/utilities/src/three/BoundingBoxLOD.ts 94.11% <0.00%> (-5.89%) ⬇️
...packages/utilities/src/WebGLRendererStateHelper.ts 94.20% <0.00%> (-5.80%) ⬇️
...packages/camera-manager/src/CameraManagerHelper.ts 89.65% <0.00%> (-4.00%) ⬇️
...providers/CadGeometryRenderModePipelineProvider.ts 93.33% <0.00%> (-3.34%) ⬇️
...ing/src/pipeline-executors/StepPipelineExecutor.ts 89.28% <0.00%> (-3.31%) ⬇️
... and 221 more

@github-actions
Copy link

There were failures in the visual tests workflow.
Image diffs for visual tests can be downloaded as an artifact here.

Copy link
Contributor

@christjt christjt left a comment

Choose a reason for hiding this comment

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

LGTM, just a couple tiny nits.

viewer/test-utilities/src/createPointCloudModel.ts Outdated Show resolved Hide resolved
viewer/test-utilities/src/createPointCloudModel.ts Outdated Show resolved Hide resolved
haakonflatval-cognite and others added 3 commits October 10, 2022 15:00
Co-authored-by: Christopher J. Tannum <christopher.tannum@cognite.com>
@haakonflatval-cognite haakonflatval-cognite merged commit bb3dcb0 into feat/point-cloud-styling Oct 10, 2022
@haakonflatval-cognite haakonflatval-cognite deleted the hflatval/point-cloud-bounding-box-fix branch October 10, 2022 13:12
haakonflatval-cognite added a commit that referenced this pull request Oct 11, 2022
* fix: point cloud bounding box shenanigans

* test: add test for point cloud transformation

* fix: height visualization for point clouds

* chore: add type to test utility function

* Update viewer/test-utilities/src/createPointCloudModel.ts

Co-authored-by: Christopher J. Tannum <christopher.tannum@cognite.com>

* chore: reduce number of characters in code

Not in commit message

* chore: lint fix

Co-authored-by: Christopher J. Tannum <christopher.tannum@cognite.com>
haakonflatval-cognite added a commit that referenced this pull request Oct 14, 2022
* fix: point cloud bounding box shenanigans

* test: add test for point cloud transformation

* fix: height visualization for point clouds

* chore: add type to test utility function

* Update viewer/test-utilities/src/createPointCloudModel.ts

Co-authored-by: Christopher J. Tannum <christopher.tannum@cognite.com>

* chore: reduce number of characters in code

Not in commit message

* chore: lint fix

Co-authored-by: Christopher J. Tannum <christopher.tannum@cognite.com>
haakonflatval-cognite added a commit that referenced this pull request Oct 18, 2022
* feat: Add ability to style objects in point clouds (#2104)

* feat: point cloud API for styling (#2179)

* feat: Webassembly setup (#2353)

* Update point cloud feature branch from master (#2416)

* feat: Rust/Webassembly octree implementation for faster point-object assignment (#2327)

* feat: custom classification (#2320)

* docs: finalize point cloud styling docs (#2500)

* refactor: move point cloud object provider to data-providers and expose object bounding boxes (#2522)

* fix: point cloud custom transformation (#2550)

* improvement: various fixes for point clouds (#2551)

* fix: export point cloud object metadata (#2552)

* Various big and small fixes

Co-authored-by: Lars Moastuen <lars.moastuen@cognite.com>
Co-authored-by: Christopher J. Tannum <christopher.tannum@cognite.com>
Co-authored-by: Savokr <savelii.novikov@cognite.com>
Co-authored-by: Pramod S <87521752+pramodcog@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
slack PRs and issues with this label will be pushed to Slack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants