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 for walls with negative heights #9041

Merged
merged 4 commits into from
Jul 20, 2020
Merged

Fix for walls with negative heights #9041

merged 4 commits into from
Jul 20, 2020

Conversation

hpinkos
Copy link
Contributor

@hpinkos hpinkos commented Jul 20, 2020

Fixes #4274
Replaces #9022

sandcastle

The removeDuplicates function in WallGeometryLibrary was making the incorrect assumption that the minimum height of the bottom of the wall would be 0, and if all positions at the top of the wall were <=0 then the height of the wall was 0 and we didn't need to render anything. This updates the removeDuplicates function to check if topHeight === bottomHeight instead of topHeight <= 0 to determine if the wall positions resulted in a wall with 0 height.

Also fixed the logic for computing wall normals so it works when the top of the wall was at height === 0 by using a position that is 1m below the top wall position instead of a position with height === 0 for the cross product computation.

@cesium-concierge
Copy link

Thanks for the pull request @hpinkos!

  • ✔️ Signed CLA found.
  • CHANGES.md was not updated.
    • If this change updates the public API in any way, please add a bullet point to CHANGES.md.
  • ❔ Unit tests were not updated.
    • Make sure you've updated tests to reflect your changes, added tests for any new code, and ran the code coverage tool.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@hpinkos
Copy link
Contributor Author

hpinkos commented Jul 20, 2020

@lilleyse can you review, or recommend someone to review? Thanks!

@lilleyse
Copy link
Contributor

I see @YoussefV was tagged in #9044.

@YoussefV are you good with reviewing this one as well afterwards?

@YVin3D
Copy link
Contributor

YVin3D commented Jul 20, 2020

For future people looking over this: here is another example of a sandcastle that shows the issue (adapted from #4274) You should be seeing a red wall. Previous code did not show a red wall

@YVin3D YVin3D merged commit 601580c into master Jul 20, 2020
@YVin3D YVin3D deleted the wall-height-fix branch July 20, 2020 21:20
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.

Wall geometries with all negative heights do not render
4 participants