CesiumGS / 3d-tiles-validator

Validator for 3D Tiles :vertical_traffic_light:
https://cesium.com
Apache License 2.0
427 stars 156 forks source link

`BOUNDING_VOLUMES_INCONSISTENT` false positive #321

Open lilleyse opened 17 hours ago

lilleyse commented 17 hours ago

A BOUNDING_VOLUMES_INCONSISTENT error is reported when a tile has a transform and its tile and content bounding boxes are equal.

{
  "asset": {
    "version": "1.1"
  },
  "geometricError": 36.01134987443187,
  "root": {
    "boundingVolume": {
      "box": [-6.080217871000059, -2.5626078567001978, 7.670572920935234, 28.222668701666407, 0.0, 0.0, 0.0, 16.052909179823477, 0.0, 0.0, 0.0, 14.046370606636636]
    },
    "geometricError": 55.168405797565356,
    "refine": "ADD",
    "transform": [0.8351817646559274, 0.4354886487600266, 0.33588845884813834, 0.0, -0.5332815258250316, 0.4919274611372525, 0.6881992351004056, 0.0, 0.13447019818509023, -0.7538945614475695, 0.6430868961655487, 0.0, 858886.5117950288, -4815266.719929179, 4080019.9862379627, 1.0],
    "content": {
      "boundingVolume": {
        "box": [-6.080217871000059, -2.5626078567001978, 7.670572920935234, 28.222668701666407, 0.0, 0.0, 0.0, 16.052909179823477, 0.0, 0.0, 0.0, 14.046370606636636]
      },
      "uri": "tiles/0/0/0/0.gltf"
    }
  }
}

Results:

{
  "date": "2024-11-22T20:57:15.797Z",
  "numErrors": 2,
  "numWarnings": 0,
  "numInfos": 0,
  "issues": [
    {
      "type": "CONTENT_VALIDATION_ERROR",
      "path": "/root/content",
      "message": "Tile content /root/content refers to URI tiles/0/0/0/0.gltf, which could not be resolved",
      "severity": "ERROR"
    },
    {
      "type": "BOUNDING_VOLUMES_INCONSISTENT",
      "path": "/root/content/boundingVolume",
      "message": "The content bounding volume is not contained in the tile bounding volume: box [-6.080217871000059,-2.5626078567001978,7.670572920935234,28.222668701666407,0,0,0,16.052909179823477,0,0,0,14.046370606636636] is not within box [-6.080217871000059,-2.5626078567001978,7.670572920935234,28.222668701666407,0,0,0,16.052909179823477,0,0,0,14.046370606636636]",
      "severity": "ERROR"
    }
  ]
}
javagl commented 16 hours ago

Oh, how confidently I copied the error message and aligned the bounding box definitions, expecting some epsilon-difference, before I noticed: "Wait, the transform is the important part here!"

This seems to be a leftover from porting the original bounding volume checks, which explicitly did set the innerTransform (for the content) to IDENTITY.

The fix should be trivial, by setting innerTransform = tile.transform here explicitly. I'll address that soon, but also want to generate some test cases (similar to the given one, but with some more "readable and understandable" boxes and transforms) to include that in the specs.