Skip to content

Commit

Permalink
Update README, CHANGES, and IMPLEMENTATION for release
Browse files Browse the repository at this point in the history
  • Loading branch information
javagl committed Nov 29, 2022
1 parent 27f037e commit 64ce2eb
Show file tree
Hide file tree
Showing 3 changed files with 93 additions and 35 deletions.
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


Version 0.0.0 - 2022-MM-YY
Version 0.1.0 - 2022-11-29

- Initial release
36 changes: 34 additions & 2 deletions IMPLEMENTATION.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 3D Tiles Validator 1.1 Implementation Notes
# 3D Tiles Validator Implementation Notes

Parts of the current implementation may still change. This page is only a short description of the overall structure.

Expand Down Expand Up @@ -50,11 +50,43 @@ The `ValidationIssue` class and its types:
- `ContentValidationIssues.ts`: Issues that are found in tile content or external tilesets
- For validation issues that refer to the tile content, each `ValidationIssue` can have an array of `causes`. This can be filled, for example, with the information from the glTF validator that caused the validation to fail


## Future Work

Certain functionalities are currently offered via the command line, but only intended for internal use:

#### Validate a single metadata schema file:
```
npx ts-node src/main.ts --metadataSchemaFile specs/data/schemas/validSchema.json
```

#### Validate a single subtree file:

**Note:** For the actual validation of standalone subtree files, there has to be a mechanism for passing in the information about the expected _structure_ of the subtree (namely, the information from the `implicitTiling` object). This example only refers to the files in the `specs` directory, which all assume the same subtree structure for now.
```
npx ts-node src/main.ts --subtreeFile specs/data/subtrees/binarySubtreeValid.subtree
```

#### Batch runs for the spec files

The `specs/data` directory contains sample files that cause different validation issues. These files can be processed with
```
npx ts-node src/main.ts --tilesetSpecs
npx ts-node src/main.ts --metadataSchemaSpecs
npx ts-node src/main.ts --subtreeSpecs
```



## API Definition

The API definition is tracked with https://api-extractor.com

After running `npm install`, the API documentation can be created with `npm run docs`. The surface API information will be written into `etc/3d-tiles-validator.api.md`. The API documentation will be written into the `build/docs` directory.
After running `npm install`, the API documentation can be created with `npm run docs`. The API documentation will be written into the `build/docs` directory. The surface API information will be written into `etc/3d-tiles-validator.api.md`. This file captures the public API, and changes in the public API will cause a warning to be printed

> Warning: You have changed the public API signature for this project. Updating etc/3d-tiles-validator.api.md
This API definition file is tracked with Git, so changes in this file should be reviewed carefully.


## Release Process
Expand Down
90 changes: 58 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# 3D Tiles Validator 1.1
<!-- omit in toc -->
# 3D Tiles Validator

A validator for 3D Tiles 1.1.
A validator for [3D Tiles](https://github.com/CesiumGS/3d-tiles).

> **A note about the repository structure**
>
Expand All @@ -10,16 +11,42 @@ A validator for 3D Tiles 1.1.
> - The `3d-tiles-samples-generator` can be found in [the `3d-tiles-samples-generator` repository](https://github.com/CesiumGS/3d-tiles-samples-generator)
>
## Command Line Usage
- [Overview](#overview)
- [Implemented Features](#implemented-features)
- [Command Line Usage](#command-line-usage)
- [Report Files](#report-files)
- [Library Usage](#library-usage)
- [Validaton Result Filtering](#validaton-result-filtering)
- [Implementation Notes](#implementation-notes)


## Overview

The 3D Tiles validator can be used to validate 3D Tiles tilesets and their associated tile content data. It supports version 1.0 and version 1.1 of the 3D Tiles specification. The validator can be used as a command line tool, or as a library.

**Note**: Some of the implementation and interfaces may still change. This refers to the source code as well as details of the command line interface and report format.

#### Validate a single tileset file:
### Implemented Features

- Validation of the JSON structure of the `tileset.json` file
- Validation of the 3D Tiles [Tile Formats](https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats)
- The supported tile formats are: Batched 3D Model (`b3dm`), Instanced 3D Model (`i3dm`), Point Cloud (`pnts`), Composite (`cmpt`)
- glTF tile content is validated with the [glTF Validator](https://github.com/KhronosGroup/glTF-Validator)
- Validation of implicit tilesets
- Validation of 3D Tiles Metadata
- This includes the validation of the JSON structure of the metadata, as well as the structure and ranges of metadata values, both for the JSON based representation and for the binary metadata that is stored in property tables
- A basic validation of the [`3DTILES_bounding_volume_S2` extension](https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_bounding_volume_S2)

## Command Line Usage

<!-- omit in toc -->
#### Validate a single tileset file
```
npx ts-node src/main.ts --tilesetFile specs/data/Samples/TilesetWithFullMetadata/tileset.json
```

#### Validate a set of tileset files:
<!-- omit in toc -->
#### Validate a set of tileset files
```
npx ts-node src/main.ts --tilesetsDirectory specs/data/Samples/
```
Expand All @@ -28,28 +55,7 @@ This will validate all tileset files in the given directory and all its subdirec
npx ts-node src/main.ts --tilesetsDirectory specs/data/Samples/ --tilesetGlobPattern **/*.json
```

#### Validate a single metadata schema file:
```
npx ts-node src/main.ts --metadataSchemaFile specs/data/schemas/validSchema.json
```

#### Validate a single subtree file:

**Note:** For the actual validation of standalone subtree files, there has to be a mechanism for passing in the information about the expected _structure_ of the subtree (namely, the information from the `implicitTiling` object). This example only refers to the files in the `specs` directory, which all assume the same subtree structure for now.
```
npx ts-node src/main.ts --subtreeFile specs/data/subtrees/binarySubtreeValid.subtree
```

#### Batch runs for the spec files

The `specs/data` directory contains sample files that cause different validation issues. These files can be processed with
```
npx ts-node src/main.ts --tilesetSpecs
npx ts-node src/main.ts --metadataSchemaSpecs
npx ts-node src/main.ts --subtreeSpecs
```

## Reports
### Report Files

By default, validation reports are printed to the console.

Expand All @@ -63,24 +69,44 @@ Alternatively, or when validating multiple files, the `writeReports` argument ca
npx ts-node src/main.ts --tilesetsDirectory specs/data/Samples/ --writeReports
```

## Validation Results

When using the validator as a library, then the output of the validator is provided as a [`ValidationResult`](https://github.com/CesiumGS/3d-tiles-validator/blob/main/src/validation/ValidationResult.ts). Clients can perform basic filtering operations on this validation result, in order to remove validation issues that are below a certain severity level, or warnings that are anticipated in a certain application context.
## Library Usage

The basic usage of the validator as a library is shown here:
```JavaScript
const { Validators } = require("3d-tiles-validator");

const resultPromise = Validators.validateTilesetFile("example.json");
resultPromise.then((result) => {
console.log(result.serialize());
});
```
The `Validators.validateTilesetFile` receives a file name, and returns a promise to the `ValidationResult`, which can then be printed to the console.

### Validaton Result Filtering

Clients can perform basic filtering operations on a `ValidationResult`, in order to remove validation issues that are below a certain severity level, or warnings that are anticipated in a certain application context.

For example, a given validation result can be filtered to
- include validation issues that have the severity `ERROR`
- exclude validation issues that have the type `EXTENSION_NOT_SUPPORTED`

by applying validation issue filters like this:
An example of applying such a filter to a given validation result is shown here:
```JavaScript
const filtered = result
const { Validators, ValidationIssueFilters } = require("3d-tiles-validator");

const resultPromise = Validators.validateTilesetFile("example.json");
resultPromise.then((result) => {
const filteredResult = result
.filter(ValidationIssueFilters.byIncludedSeverities(ValidationIssueSeverity.ERROR))
.filter(ValidationIssueFilters.byExcludedTypes("EXTENSION_NOT_SUPPORTED"));
console.log(filteredResult.serialize());
});
```

**Note**: The `type` strings that are used for describing and categorizing the validation issues are not part of the core API. These strings might change between minor- or patch releases. But changes will be pointed out in the change log.

## Implementation notes
## Implementation Notes

See [`IMPLEMENTATION.md`](IMPLEMENTATION.md) for implementation notes.

0 comments on commit 64ce2eb

Please sign in to comment.