CesiumGS/cesium

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

https://sandcastle.cesium.com/#c=hVNtb9owEP4rFh/apAsOFGWbIKB1VFonsTGxl0+RKpMcYM2xme2A2Mp/3zkkJHSVZkVJfPfc47vnzqmSxpIdhz1oMiYS9mQKhhc5/VHavKSTlvupkpZxCTrp+KNEniJoynLQjBqwDu79SSTBlYGxXDLLlSTDmm/KtMU/Jgd0pVV+D2sNYLxu/20vIPj0o55btOcn8uiOSGRaJseExcz6pbeHdgGWGItsM7l2jjfRqIYK5qA1iMtUQw6yDC8J91xmak+5tKB3TKAdM/9Y7TzPH09IVUJVHwZzy8FQJFI7uBPCc6m9hGBZVtfvlkRlhuTafa6DxrxVhjtd/idLXWDgavJbBOlBYBGgh6R1mFsC5Npuhk6u4NJj1XbBMl6YIep86Voqa1Vee53SIRk0kGMLnjOUiTPRZK6E0mXS7w9Ygje4dU3E123kOkqjiNzgf9TOfgN8vbELWIEGmcKZ6+HSTqezu09fHr/NHz8s5t8/358IjrX05+6/GjdNrnx8ddaOTAgOl98W6uzqjsngda+KOZ5DSTu4R66umogYJw3Jnp5amPgZZkK6DnRxZDOFN2N0Xx5ZDZFJQQLO2K8Cb84CXH9xzhwA70JQzr4/6gSd2NiDgElN/o7nW6UtKbTwKA0t5FucFjDhskh/gqWpMbVkcdgOjTO+Izwbv3C5SSqYMehZFUJ85b8h6UziEPH/hAqFYyPX8x1owQ4OtulPZicjpTQOcftypFVKLJl+xvwX

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!