Cesium Cylinder Can't Move Across Dateline/Antimeridian
mlptownsend opened this issue · 2 comments
What happened?
We had a Cesium example crash, and it appears to not like it when a Cesium cylinder entity is moved across the dateline. I made a Sandcastle repro, linked below. A big cylinder is moved from longitude 175 towards 180, but after a few steps Cesium crashes with "DeveloperError: All attribute lists must have the same number of attributes."
Error
at new DeveloperError (blob:https://sandcastle.cesium.com/f3d8ea92-0ade-4aa2-ad5b-1cb965be6240:64:13)
at Geometry.computeNumberOfVertices (blob:https://sandcastle.cesium.com/f3d8ea92-0ade-4aa2-ad5b-1cb965be6240:16088:21)
at updateGeometryAfterSplit (blob:https://sandcastle.cesium.com/f3d8ea92-0ade-4aa2-ad5b-1cb965be6240:19064:47)
at updateInstanceAfterSplit (blob:https://sandcastle.cesium.com/f3d8ea92-0ade-4aa2-ad5b-1cb965be6240:19099:20)
at splitLongitudeTriangles (blob:https://sandcastle.cesium.com/f3d8ea92-0ade-4aa2-ad5b-1cb965be6240:19496:5)
at GeometryPipeline.splitLongitude (blob:https://sandcastle.cesium.com/f3d8ea92-0ade-4aa2-ad5b-1cb965be6240:20905:13)
at geometryPipeline (blob:https://sandcastle.cesium.com/f3d8ea92-0ade-4aa2-ad5b-1cb965be6240:21164:36)
at PrimitivePipeline.combineGeometry (blob:https://sandcastle.cesium.com/f3d8ea92-0ade-4aa2-ad5b-1cb965be6240:21453:24)
at combineGeometry (blob:https://sandcastle.cesium.com/f3d8ea92-0ade-4aa2-ad5b-1cb965be6240:21835:47)
at onMessageHandler (blob:https://sandcastle.cesium.com/f3d8ea92-0ade-4aa2-ad5b-1cb965be6240:21781:30)
Reproduction steps
See sandcastle link for repro.
Sandcastle example
Environment
Browser: Chrome 124.0.6367.208 / Firefox 126.0.1
CesiumJS Version: v1.115+
Operating System: Windows
Hi there,
We've seen some similar reports of problems with geometries crossing the IDL, but this looks like it may be a unique case due to the crash.
It looks like there is a problem when the geometry is split across the IDL. This is done to allow visualization in 2D. Is 2D mode needed for your case? If not, a workaround would be to create the viewer with the following scene3DOnly
option:
const viewer = new Cesium.Viewer("cesiumContainer", {
scene3DOnly: true
});
Yeah I can do that in this case, thanks!