-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 rectangles at north and south poles #7452
Conversation
Thanks for the pull request @hpinkos!
Reviewers, don't forget to make sure that:
I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
This doesn't fix #1297. It doesn't crash, but the artifact is still there. Here is the updated code example: var viewer = new Cesium.Viewer('cesiumContainer');
viewer.entities.add({
rectangle : {
coordinates : Cesium.Rectangle.fromDegrees(-180.0, 45.0, -160.0, 90.0),
outline : true,
outlineColor : Cesium.Color.WHITE,
material : Cesium.Color.BLUE,
height : 0.0
}
}); The only difference between this code and that in the issue is |
Gotcha. I remembered to set |
@bagnell merged in master. Anything else? |
No, this looks good. Merging. |
Fixes #7406
Fixes #4760
When the rectangle north is the north pole, it comes to a single point instead of a row of points at the top edge.
RectangleGeometry
was creating a ton of duplicate points and every other triangle at the north pole had zero area, which was causing things to go weird further up the geometry pipeline (specifically whensplitLongitude
was trying to use barycentric coordinates to compute attributes).Similarly for the south pole and the bottom edge.
This change creates a single north pole position and/or south pole position and triangulates accordingly.
For an example, this rectangle crashes in master, but is fixed in this branch: