Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle missing 'refine' in root #303

Merged
merged 8 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@gltf-transform/core": "^3.2.1",
"@gltf-transform/extensions": "^3.2.1",
"@gltf-transform/functions": "^3.2.1",
"3d-tiles-tools": "0.3.1",
"3d-tiles-tools": "0.4.1",
"cesium": "^1.97.0",
"gltf-validator": "^2.0.0-dev.3.9",
"minimatch": "^5.1.0",
Expand Down
16 changes: 16 additions & 0 deletions specs/TilesetValidationSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,22 @@ describe("Tileset validation", function () {
expect(result.get(0).type).toEqual("VALUE_NOT_IN_LIST");
});

it("detects issues in tileRefineMissingInRoot", async function () {
const result = await Validators.validateTilesetFile(
"specs/data/tilesets/tileRefineMissingInRoot.json"
);
expect(result.length).toEqual(1);
expect(result.get(0).type).toEqual("TILE_REFINE_MISSING_IN_ROOT");
});

it("detects issues in tileRefineMissingInRootOfExternal", async function () {
const result = await Validators.validateTilesetFile(
"specs/data/tilesets/tileRefineMissingInRootOfExternal.json"
);
expect(result.length).toEqual(1);
expect(result.get(0).type).toEqual("EXTERNAL_TILESET_VALIDATION_ERROR");
});

it("detects issues in tileRefineWrongCase", async function () {
const result = await Validators.validateTilesetFile(
"specs/data/tilesets/tileRefineWrongCase.json"
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/assetTilesetVersionInvalidType.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/assetVersionInvalidType.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/assetVersionMissing.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/assetVersionUnknown.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/extensionFoundButNotUsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ],
"extensions": {
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/extensionNotDeclared_1_0_glTF.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/extensionNotNecessary_1_1_glTF.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/extensionRequiredButNotUsed.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/extensionUsedButNotFound.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ],
"extensions": {
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/extensionsInvalidType.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/extensionsRequiredInvalidType.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/extensionsUsedDuplicateElement.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/extensionsUsedInvalidArrayLength.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/extensionsUsedInvalidType.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/extensionsValueInvalidType.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/extrasUnexpectedType.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/groupClassIdInvalid.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
],
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/groupClassIdInvalidType.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
],
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/groupWithoutSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
],
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
Binary file modified specs/data/tilesets/packages/tilesetPackageWithWarnings.3dtiles
Binary file not shown.
Binary file modified specs/data/tilesets/packages/tilesetPackageWithWarnings.3tz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
Binary file modified specs/data/tilesets/packages/validTilesetPackage.3dtiles
Binary file not shown.
Binary file modified specs/data/tilesets/packages/validTilesetPackage.3tz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
Binary file modified specs/data/tilesets/packages/validTilesetPackageZipped.3dtiles
Binary file not shown.
Binary file modified specs/data/tilesets/packages/validTilesetPackageZipped.3tz
Binary file not shown.
1 change: 1 addition & 0 deletions specs/data/tilesets/propertiesInvalidType.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/propertiesMaximumInvalidType.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/propertiesMaximumMissing.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/propertiesMinimumInvalidType.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/propertiesMinimumMissing.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/statisticsClassesIdInvalid.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"geometricError": 2.0,
"root": {
"refine": "REPLACE",
"boundingVolume": {
"box": [0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/statisticsClassesInvalidType.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"geometricError": 2.0,
"root": {
"refine": "REPLACE",
"boundingVolume": {
"box": [0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/statisticsClassesValueInvalidType.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/statisticsClassesWithoutSchema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/tileChildrenEmptyArray.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/tileGeometricErrorMissing.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
}
Expand Down
1 change: 1 addition & 0 deletions specs/data/tilesets/tileGeometricErrorNegative.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 2.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
},
"geometricError" : 8.0,
"root" : {
"refine": "REPLACE",
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
Expand Down
21 changes: 21 additions & 0 deletions specs/data/tilesets/tileRefineMissingInRoot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"asset" : {
"version" : "1.1"
},
"geometricError" : 2.0,
"root" : {
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
"geometricError" : 1.0,
"children": [
{
"boundingVolume" : {
"box" : [ 0.5, 0.5, 0.5, 0.5, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.5 ]
},
"geometricError" : 0.0,
"refine": "ADD"
}
]
}
}
Loading
Loading