loaders.gl icon indicating copy to clipboard operation
loaders.gl copied to clipboard

[3d-tiles] `parseImplicitTiles` fails to load subtree if `availableLevels` in the implicit tiling scheme is `1`

Open brncsk opened this issue 1 year ago • 0 comments

The condition in the line below fails to account for the case when maximumLevel is 0:

https://github.com/visgl/loaders.gl/blob/d74df445180408fd772567ca6a6bbb8d42aa50be/modules/3d-tiles/src/lib/parsers/helpers/parse-3d-implicit-tiles.ts#L139

I'm admittedly no 3d tiles expert but I guess this should be !Number.isFinite(maximumLevel) in order to cater for tilesets where the implicit tiling scheme defines a single level (copy-pasting the following from a Cesium Tileset we're using):

    "implicitTiling": {
      "subdivisionScheme": "OCTREE",
      "subtreeLevels": 5,
      "availableLevels": 1,
      "subtrees": { "uri": "subtrees/{level}/{x}/{y}/{z}.subtree" }
    },

maximumLevel is being set to 0 here in normalizeImplicitTileHeaders():

https://github.com/visgl/loaders.gl/blob/d74df445180408fd772567ca6a6bbb8d42aa50be/modules/3d-tiles/src/lib/parsers/parse-3d-tile-header.ts#L226

brncsk avatar Mar 09 '25 08:03 brncsk