I am trying to load a tileset that contains a .glb, that utilizes “Sparse Accessors” and “EXT_mesh_features”. 3D tiles are served via Cesium-ion. I think there is a bug in CesiumJS. Here is the error I am getting:
TypeError: attribute.value.slice is not a function
at addAttribute (http://localhost:4200/projects_stac_src_app_pages_explorer-3d_explorer-3d_module_ts.js:194881:39)
at new VertexArray (http://localhost:4200/projects_stac_src_app_pages_explorer-3d_explorer-3d_module_ts.js:195079:5)
at buildDrawCommand (http://localhost:4200/projects_stac_src_app_pages_explorer-3d_explorer-3d_module_ts.js:284191:23)
at push.46753.ModelSceneGraph.buildDrawCommands (http://localhost:4200/projects_stac_src_app_pages_explorer-3d_explorer-3d_module_ts.js:278861:92)
at buildDrawCommands (http://localhost:4200/projects_stac_src_app_pages_explorer-3d_explorer-3d_module_ts.js:272526:23)
at push.86789.Model.update (http://localhost:4200/projects_stac_src_app_pages_explorer-3d_explorer-3d_module_ts.js:272341:3)
at push.5985.Model3DTileContent.update (http://localhost:4200/projects_stac_src_app_pages_explorer-3d_explorer-3d_module_ts.js:273673:9)
at push.34426.Cesium3DTile.process (http://localhost:4200/projects_stac_src_app_pages_explorer-3d_explorer-3d_module_ts.js:211306:19)
at processTiles (http://localhost:4200/projects_stac_src_app_pages_explorer-3d_explorer-3d_module_ts.js:218218:12)
at push.11992.Cesium3DTileset.prePassesUpdate (http://localhost:4200/projects_stac_src_app_pages_explorer-3d_explorer-3d_module_ts.js:218045:3)
Did some digging into the stack trace, here’s what I found out:
The value of the attribute is 0.
hasValue is true.
it crashes here. It assumes that the value should be an array.
Here is the buffer view and the accessor:
"bufferViews": [
{
"buffer": 0,
"byteOffset": 0,
"byteLength": 640800,
"byteStride": 32,
"target": 34962
},
{
"buffer": 0,
"byteOffset": 640800,
"byteLength": 40052,
"target": 34963
},
{
"buffer": 0,
"byteOffset": 680852,
"byteLength": 140700
},
{
"buffer": 0,
"byteOffset": 821552,
"byteLength": 140700
}
],
"accessors": [
..........
{
"type": "SCALAR",
"componentType": 5123,
"count": 20025,
"sparse": {
"count": 2,
"indices": {
"bufferView": 2,
"byteOffset": 140696,
"componentType": 5123
},
"values": {
"bufferView": 3,
"byteOffset": 140696
}
}
}
]