Skip to content

Commit

Permalink
Add cylinder region extension
Browse files Browse the repository at this point in the history
  • Loading branch information
j9liu committed Oct 25, 2024
1 parent 1244f79 commit 2b387c0
Show file tree
Hide file tree
Showing 2 changed files with 144 additions and 0 deletions.
96 changes: 96 additions & 0 deletions extensions/2.0/Vendor/EXT_implicit_cylinder_region/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# EXT_implicit_cylinder_region

## Contributors
- Sean Lilley, Cesium
- Janine Liu, Cesium

## Status
Draft

## Dependencies
Written against the glTF 2.0 specification.

## Overview

This extension adds an cylinder-based region as an additional shape type to the [`KHR_implicit_shapes`](TODO) extension. Cylinder-based regions are useful for visualizing real-world data that is captured by cylindrical sensors.

`EXT_implicit_cylinder_region` is an extension on the `shape` object in `KHR_implicit_shapes`, where `type` should be set to `"cylinder region"`.

The extension's properties specify a region following the surface of a cylinder between two different radius values. The cylinder does not need to be completely represented by the volume; the region may be hollow inside, like a tube. However, an inner radius of `0` results in a completely solid cylinder volume.

### Details

The cylinder is centered at the origin, where the radius is measured along the `x` and `z` axes. The `height` of the cylinder is aligned with the `y` axis.

<table>
<tr>
<th>
Example
</th>
</tr>
<tr>
<td><pre>
"extensions": [
{
"KHR_implicit_shapes": {
"shapes": [
{
"type": "cylinder region",
"extensions": {
"EXT_implicit_cylinder_region": {
"minRadius": 0.5,
"maxRadius": 1,
"height": 2
}
}
}
]
}
}
]
</pre></td>
<td>
**TODO** visual example
</td>
</tr>
</table>

A cylinder region may also be confined to a specific angular range. The `minAngle` and `maxAngle` properties represent the angles at which the region starts and stops on the cylinder. The cylinder's angular bounds are defined in radians within the range `[-pi, pi]`.

<table>
<tr>
<th>
Example
</th>
</tr>
<tr>
<td><pre>
"extensions": [
{
"KHR_implicit_shapes": {
"shapes": [
{
"type": "cylinder region",
"extensions": {
"EXT_implicit_cylinder_region": {
"minRadius": 0.5,
"maxRadius": 1,
"height": 2,
"minAngle": 0
"maxAngle": 1.5
}
}
}
]
}
}
]
</pre></td>
<td>
**TODO** visual example
</td>
</tr>
</table>

## Optional vs. Required
This extension is required, meaning it should be placed in both the `extensionsUsed` list and `extensionsRequired` list.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "glTF.KHR_implicit_shapes.shape.EXT_implicit_cylinder_region.schema.json",
"title": "EXT_implicit_cylinder_region extension on KHR_implicit_shapes.shape",
"type": "object",
"description": "`EXT_implicit_cylinder_region` extension on `KHR_implicit_shapes.shape` to represent an implicit cylinder region in a glTF model.",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
}
],
"properties": {
"minRadius": {
"type": "number",
"description": "The inner radius of the cylinder region along the X and Z axes, in meters.",
"minimum": 0
},
"maxRadius": {
"type": "number",
"description": "The outer radius of the cylinder region along the X and Z axes, in meters.",
"minimum": 0
},
"height": {
"type": "number",
"description": "The height of the cylinder in meters along the Y-axis, in meters.",
"minimum": 0
},
"minAngle": {
"type": "number",
"description": "The minimum angle of the cylinder region in radians. In other words, this is the angle where the cylinder region starts. Must be in the range [-pi, pi].",
"minimum": -3.14159265359,
"maximum": 3.14159265359,
"default": -3.14159265359
},
"maxAngle": {
"type": "number",
"description": "The maximum angle of the cylinder region in radians. In other words, this is the angle where the cylinder region ends. Must be in the range [-pi, pi].",
"minimum": -3.14159265359,
"maximum": 3.14159265359,
"default": 3.14159265359
}
},
"required": [
"minRadius",
"maxRadius",
"height"
]
}

0 comments on commit 2b387c0

Please sign in to comment.