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

Fix combine with multiple contents #139

Merged
merged 9 commits into from
Jun 24, 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
18 changes: 18 additions & 0 deletions specs/data/combineTilesets/externalInSameDirectory/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
A regression test for https://github.com/CesiumGS/3d-tiles-tools/issues/138

```
tileset.json refers to
sub0/externalA.json

sub0/externalA.json refers to
tileA.b3dm
externalB.json

sub0/externalB.json refers to
tileB.b3dm
```

The content URI for `tileB.b3dm` of the combined result should be `sub0/tileB.b3dm`



Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"asset": {
"version": "1.1"
},
"geometricError": 4.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": 2.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": 1.0,
"content": {
"uri": "tileA.b3dm"
}
},
{
"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,
"content": {
"uri": "externalB.json"
}
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"asset": {
"version": "1.1"
},
"geometricError": 4.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": 2.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": 1.0,
"content": {
"uri": "tileB.b3dm"
}
}
]
}
}
Empty file.
Empty file.
23 changes: 23 additions & 0 deletions specs/data/combineTilesets/externalInSameDirectory/tileset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"asset": {
"version": "1.1"
},
"geometricError": 4.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": 2.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": 1.0,
"content": {
"uri": "sub0/externalA.json"
}
}
]
}
}
28 changes: 28 additions & 0 deletions specs/data/combineTilesets/externalMultipleContents/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
A test for the handling of multiple contents in the `combine` command
(Brought up in https://github.com/CesiumGS/3d-tiles-tools/issues/138 )

The cases that are differentiated here:

- A tile refers to a SINGLE content, which is an external tileset
- In this case, the properties of the tile will be "replaced" with the properties of the external root
- A tile refers to an multiple contents, including external tilesets
- In this case, the external roots will be added as children to the tile

---

- The `tileset.json` root
- No children
- Multiple contents: `tile.b3dm`, `/subA/externalA.json`, `/subB/externalB.json`
- The result root should have one content and two children

- The `/subA/externalA.json` root:
- Multiple contents: `tileA0.b3dm`, `tileA1.b3dm`
- No content
- This should be the first child of the result root

- The `/subB/externalB.json` root:
- A single content: `externalB0.json`
- No children
- The `externalB0.json` contains two contents, `tileB0x.b3dm` and `tileB0y.b3dm`.
- These should be put into root of the `/subB/externalB.json`
- This will be the second child of the result root
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"asset": {
"version": "1.1"
},
"geometricError": 4.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": 2.0,
"contents": [
{
"uri": "tileA0.b3dm"
},
{
"uri": "tileA1.b3dm"
}
]
}
}
Empty file.
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"asset": {
"version": "1.1"
},
"geometricError": 4.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": 2.0,
"content": {
"uri": "externalB0.json"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"asset": {
"version": "1.1"
},
"geometricError": 4.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": 2.0,
"contents": [
{
"uri": "tileB0x.b3dm"
},
{
"uri": "tileB0y.b3dm"
}
]
}
}
Empty file.
Empty file.
Empty file.
23 changes: 23 additions & 0 deletions specs/data/combineTilesets/externalMultipleContents/tileset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"asset": {
"version": "1.1"
},
"geometricError": 4.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": 2.0,
"contents": [
{
"uri": "tile.b3dm"
},
{
"uri": "subA/externalA.json"
},
{
"uri": "subB/externalB.json"
}
]
}
}
5 changes: 5 additions & 0 deletions specs/data/combineTilesets/externalWithUrl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
A test for the `combine` functionality based on a tileset that uses
the (legacy) `url` property for its contents.

See https://github.com/CesiumGS/3d-tiles-tools/issues/43

23 changes: 23 additions & 0 deletions specs/data/combineTilesets/externalWithUrl/external.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"asset": {
"version": "1.0"
},
"geometricError": 4.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": 2.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": 1.0,
"content": {
"url": "tile.b3dm"
}
}
]
}
}
Empty file.
23 changes: 23 additions & 0 deletions specs/data/combineTilesets/externalWithUrl/tileset.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"asset": {
"version": "1.0"
},
"geometricError": 4.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": 2.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": 1.0,
"content": {
"url": "external.json"
}
}
]
}
}
Loading
Loading