CesiumGS / 3d-tiles-tools

Apache License 2.0
315 stars 47 forks source link

Extend `analyze` command to provide subtree information #135

Open javagl opened 6 months ago

javagl commented 6 months ago

Addresses https://github.com/CesiumGS/3d-tiles-tools/issues/131 :

This is a first draft of extending the analyze command to provide detailed information about .subtree files.

As described in the issue: Interpreting the subtree files requires external information about whether the data refers to a quadtree or an octree. And one could make a case that it is inconvenient for call the analyze command for each subtree file of a tileset, always passing in that structural information. So for now, preliminarily, the implementation here takes the tileset.json as the input, traverses the tileset, and collects the information about the subtrees.

It will collect the information about all subtrees in a single Markdown file. So the output is (intentionally) similar to the https://github.com/CesiumGS/3d-tiles-samples/blob/main/1.1/SparseImplicitQuadtree/screenshot/subtreeInfo.md that is included in some of the 3D Tiles Samples. (with small differences - the information there was created during the creation of the tilesets, with my (private) Java 3D Tiles implementation).

Until now, I only tested it with the simple examples from the 3D Tiles Samples. And it is not unlikely that for "real", larger tilesets, the resulting markdown string could become huge and a bit difficult to handle. This may not be sooo critical when the analyze command is only used as intended, namely for basic tests and debugging. But one has to expect that people will apply it to larger tilesets as well. Maybe there should somehow be the possibilities to...

(The latter is what I did here initially, but ... having many output files can also be inconvenient)


As an example, the output of running the analyze command on the 'SparseImplicitQuadtree' sample is attached here:

tileset.json.subtrees.md