Skip to content

Commit b82cd63

Browse files
authored
Fix missing cesium-sandcastle command docs (#81)
1 parent b8c6396 commit b82cd63

4 files changed

Lines changed: 43 additions & 4 deletions

File tree

docs/_sidebar.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@
5151
* [owner](access-control/member/owner/overview.md)
5252
* [user](access-control/member/user/overview.md)
5353
* [combined commands](combined-commands/overview.md)
54-
* [synchronization](combined-commands/synchronization.md)
54+
* [synchronization](combined-commands/synchronization.md)
55+
* [cesium sandcastle](combined-commands/cesium-sandcastle.md)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Cesium Sandcastle Export
2+
3+
The Cesium Sandcastle export command allows you to generate a URL to view an iModel in Cesium Sandcastle. This URL can be used to visualize 3D tilesets in a Cesium environment.
4+
5+
**Workflow steps:**
6+
7+
1. **Create Export**
8+
Use the [Create Export](https://developer.bentley.com/apis/mesh-export/operations/create-export/) API to generate a new export for the specified iModel and changeset.
9+
- Input: iModel ID, changeset ID, and export type (`CESIUM`).
10+
- Output: Export ID and status.
11+
12+
2. **Check Export Status**
13+
Use the [Get Export](https://developer.bentley.com/apis/mesh-export/operations/get-export/) API to check the status of the export.
14+
- Poll the export status until it is marked as `Complete`.
15+
16+
3. **Extract Tileset URL**
17+
Parse the `_links.mesh.href` property from the completed export to retrieve the tileset URL.
18+
19+
4. **Generate Sandcastle URL**
20+
Compress the tileset URL and embed it into a Cesium Sandcastle URL.
21+
- Use the `deflate` function to compress the data and encode it in Base64 format.
22+
23+
5. **Open in Browser (Optional)**
24+
If the `--open` flag is provided, open the generated URL in the default browser.
25+
26+
## Notes
27+
28+
1. The export type must be `CESIUM` to generate a tileset compatible with Cesium Sandcastle.
29+
2. The tileset URL is extracted from the `_links.mesh.href` property of the export response.
30+
3. The generated URL can be opened directly in a browser or shared with others.
31+
32+
## References
33+
34+
- [Cesium Sandcastle](https://sandcastle.cesium.com/)
35+
- [Create Export API](https://developer.bentley.com/apis/mesh-export/operations/create-export/)
36+
- [Get Export API](https://developer.bentley.com/apis/mesh-export/operations/get-export/)
37+

docs/combined-commands/overview.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ Workflow reference for combined commands (such as `imodel populate`) that combin
44

55
## Workflows
66

7-
- [Synchronization](combined-commands/synchronization.md)
7+
- [Synchronization](combined-commands/synchronization.md)
8+
- [Cesium Sandcastle Export](combined-commands/cesium-sandcastle.md)

docs/imodel/view/cesium-sandcastle.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ itp imodel view cesium-sandcastle --imodel-id 5e19bee0-3aea-4355-a9f0-c6df9989ee
2929
itp imodel view cesium-sandcastle --imodel-id 5e19bee0-3aea-4355-a9f0-c6df9989ee7d --changeset-id 2f3b4a8c92d747d5c8a8b2f9cde6742e5d74b3b5 --open
3030
```
3131

32-
## API Reference
32+
## Workflow Reference
3333

34-
[Cesium Sandcastle](https://cesium.com/docs/sandcastle/)
34+
[Cesium Sandcastle](/combined-commands/cesium-sandcastle)

0 commit comments

Comments
 (0)