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: cone rendering sometimes overshooting #4616

Merged
merged 1 commit into from
Jun 19, 2024

Conversation

haakonflatval-cognite
Copy link
Contributor

Type of change

Bug

Jira ticket 📘

https://cognitedata.atlassian.net/browse/

Description 📝

Fix a bug where cones would sometimes have too large arc angle.

Before:
bg1

After:
bg0

In technical terms, the variable theta is initialized to a number between -pi and pi. The code would then add 2 pi if it was less than the starting angle of the arc, to ensure that it is larger than that starting angle. However, there is a chance that theta can be e.g. -pi/2 and the starting angle could be 7/4 pi, in which case adding 2 pi will not make theta large enough. Thus, we run the same computation again to be sure that theta is larger that the starting angle.

How has this been tested? 🔍

In react-components storybook. Model

    modelId: 1728775548730849,
    revisionId: 3207495738912031,

in 3d-test, greenfield

camera parameters

      position: new Vector3(366.85257310981, 526.1938224394785, -84.046445931295669),
      target: new Vector3(366.98927413563297, 525.5736676178238, -86.10111922871693)

Test instructions ℹ️

Checklist ☑️

  • I am proud of this feature.
  • I have performed a self-review of my own code.
  • I have added PR type (Feat, Bug, Chore, Test, Docs, Style, Refactor) to the PR title.
  • 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 requested a review from a team as a code owner June 19, 2024 11:47
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.

👏 👏 👏 👏 👏 👏 👏 👏 👏 👏

@haakonflatval-cognite haakonflatval-cognite enabled auto-merge (squash) June 19, 2024 11:49
@haakonflatval-cognite haakonflatval-cognite merged commit 49aea0a into master Jun 19, 2024
12 checks passed
@haakonflatval-cognite haakonflatval-cognite deleted the hflatval/fix-cone-render branch June 19, 2024 11:52
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