Skip to content

Commit

Permalink
Add voxel grid geometry schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
j9liu committed May 30, 2024
1 parent 40ebbdb commit c805aaf
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "bounds.schema.json",
"title": "Bounds",
"$id": "box.schema.json",
"title": "Box",
"type": "object",
"description": "The bounds property describes which section of the primitive is mapped to the voxel grid. bounds.min and bounds.max specify a rectangular region of the voxel grid in the appropriate coordinate system.",
"description": "The box property indicates that the voxels conform to a box-based grid. box.min and box.max represent the corners of the box grid in local coordinates.",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "cylinder.schema.json",
"title": "Cylinder",
"type": "object",
"description": "The cylinder property indicates that the voxels conform to a cylindrical grid. Each sub-property defines the section of the cylinder that the grid actually occupies.",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
}
],
"properties": {
"radius": {
"type": "array",
"description": "The radial extents of the cylindrical grid in local space. The elements represent the minimum and maximum values respectively.",
"items": {
"type": "number",
"minimum": 0
},
"minItems": 2,
"maxItems": 2
},
"height": {
"type": "array",
"description": "The height extents of the cylindrical grid in local space. The elements represent the minimum and maximum values respectively.",
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 2
},
"angle": {
"type": "array",
"description": "The angular extents of the cylindrical grid in local space. Values must be in the range [-pi, pi]. The elements represent the minimum and maximum values respectively.",
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 2
}
},
"required": [
"radius",
"height"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "ellipsoid.schema.json",
"title": "Ellipsoid",
"type": "object",
"description": "The ellipsoid property indicates that the voxels conform to an ellipsoidal grid. Each sub-property defines the section of the ellipsoid that the grid actually occupies.",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
}
],
"properties": {
"radii": {
"type": "array",
"description": "The radii of the ellipsoid along the X, Y, and Z axes in the local coordinate system.",
"items": {
"type": "number",
"minimum": 0
},
"minItems": 3,
"maxItems": 3
},
"longitude": {
"type": "array",
"description": "The range along the longitude of the ellipsoid that the grid occupies. The elements represent the minimum and maximum values (west and east) respectively.",
"items": {
"type": "number",
"minimum": -180.0,
"maximum": 180.0
},
"minItems": 2,
"maxItems": 2
},
"latitude": {
"type": "array",
"description": "The range along the latitude of the ellipsoid that the grid occupies. The elements represent the minimum and maximum values (south and north) respectively.",
"items": {
"type": "number",
"minimum": -90.0,
"maximum": 90.0
},
"minItems": 2,
"maxItems": 2
},
"ratio": {
"type": "array",
"description": "The ratio along the radii of the ellipsoid that the grid occupies. The elements represent the minimum and maximum values respectively.",
"items": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"minItems": 2,
"maxItems": 2
},
"height": {
"type": "array",
"description": "The range of height above or below the ellipsoid that the grid occupies. Negative values are inside the ellipsoid, while positive values are outside. The elements represent the minimum and maximum values respectively.",
"items": {
"type": "number"
},
"minItems": 2,
"maxItems": 2
}
},
"required": [
"radii"
],
"oneOf": [
"ratio",
"height"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,25 @@
"minItems": 3,
"maxItems": 3
},
"bounds": {
"$ref": "bounds.schema.json"
"box": {
"$ref": "box.schema.json"
},
"cylinder": {
"$ref": "cylinder.schema.json"
},
"ellipsoid": {
"$ref": "ellipsoid.schema.json"
},
"padding": {
"$ref": "padding.schema.json"
}
},
"required": [
"dimension",
"bounds"
"dimensions"
],
"oneOf": [
{ "required": [ "box" ] },
{ "required": [ "cylinder" ] },
{ "required": [ "ellipsoid" ] }
]
}

0 comments on commit c805aaf

Please sign in to comment.