Skip to content

EXT_implicit_cylinder_region Proposal #2495

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
110 changes: 110 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,110 @@
# EXT_implicit_cylinder_region

## Contributors

- Janine Liu, Cesium
- Sean Lilley, Cesium

## Status

Draft

## Dependencies

Written against the glTF 2.0 specification. Depends on the [`KHR_implicit_shapes`](https://github.com/eoineoineoin/glTF/tree/refs/heads/collisionShapeMerge/extensions/2.0/Khronos/KHR_implicit_shapes) extension.

## Overview

This extension defines a cylinder-conforming region as an additional shape type for the `KHR_implicit_shapes` extension. These regions are useful for visualizing real-world data that has been captured by cylindrical sensors.

`EXT_implicit_cylinder_region` extends the `shape` object in `KHR_implicit_shapes`. The `shape.type` should be set to `"cylinder region"`. The properties define 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—for instance, the region may be hollow inside like a tube. However, an inner radius of `0` results in a completely solid cylinder.

### 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>

```json
"extensions": [
{
"KHR_implicit_shapes": {
"shapes": [
{
"type": "cylinder region",
"extensions": {
"EXT_implicit_cylinder_region": {
"minRadius": 0.5,
"maxRadius": 1,
"height": 2
}
}
}
]
}
}
]
```

</td>
<td>
<img src="figures/hollow-cylinder.png">
</td>
</tr>
</table>

A cylinder region may also be confined to a certain angular range. The `minAngle` and `maxAngle` properties define the angles at which the region starts and stops on the cylinder.

Angles are given in radians within the range `[-pi, pi]` and open counter-clockwise around the cylinder. The bounds are aligned such that an angle of `0` aligns with the glTF right axis, i.e., the `-x` axis (see figure below.)

![](figures/cylinder-angle.png)

<table>
<tr>
<th>
Example
</th>
</tr>
<tr>
<td>

```json
"extensions": [
{
"KHR_implicit_shapes": {
"shapes": [
{
"type": "cylinder region",
"extensions": {
"EXT_implicit_cylinder_region": {
"minRadius": 0.5,
"maxRadius": 1,
"height": 2,
"minAngle": -1.570796,
"maxAngle": 1.570796
}
}
}
]
}
}
]
```
</td>
<td>
<img src="figures/half-cylinder.png">
</td>
</tr>
</table>

## Optional vs. Required
This extension is required, meaning it should be placed in both the `extensionsUsed` list and `extensionsRequired` list.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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": "Extension of `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"
]
}