399 lines
9.1 KiB
Python
399 lines
9.1 KiB
Python
# generated by datamodel-codegen:
|
|
# filename: scene-1.0.schema.json
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any, Literal, TypedDict
|
|
|
|
from typing_extensions import NotRequired
|
|
|
|
SafeInteger = int
|
|
|
|
|
|
Number = float
|
|
|
|
|
|
PositiveNumber = float
|
|
|
|
|
|
LogicalId = str
|
|
|
|
|
|
ProductId = str
|
|
|
|
|
|
StructuralId = str
|
|
|
|
|
|
Hash = str
|
|
|
|
|
|
Uri = str
|
|
|
|
|
|
Token = str
|
|
|
|
|
|
Vec3 = list[Number]
|
|
|
|
|
|
ColorItem = float
|
|
|
|
|
|
Color = list[ColorItem | Literal[1]]
|
|
|
|
|
|
class Transform(TypedDict):
|
|
origin: Vec3
|
|
x_axis: Vec3
|
|
y_axis: Vec3
|
|
z_axis: Vec3
|
|
|
|
|
|
class Bounds(TypedDict):
|
|
min: Vec3
|
|
max: Vec3
|
|
|
|
|
|
class Generator(TypedDict):
|
|
name: Literal["simplecadapi"]
|
|
simplecadapi_version: Token
|
|
ocp_version: Token
|
|
ocp_bindings_version: Token
|
|
python_abi: Token
|
|
platform_tag: Token
|
|
toolchain_hash: Hash
|
|
profile: Literal["scene-1.0-ocp-glb-1", "scene-1.0-ocp-glb-2"]
|
|
|
|
|
|
class ProductPackageSource(TypedDict):
|
|
kind: Literal["part_package", "assembly_package"]
|
|
definition_id: ProductId
|
|
revision: Hash
|
|
artifact_hash: Hash
|
|
|
|
|
|
class SourceFile(TypedDict):
|
|
path: str
|
|
uri: Uri
|
|
media_type: Literal["text/x-python; charset=utf-8"]
|
|
byte_length: SafeInteger
|
|
content_hash: Hash
|
|
|
|
|
|
class ImportedSource(TypedDict):
|
|
kind: Literal["imported"]
|
|
format: Token
|
|
artifact_hash: Hash
|
|
embedded_artifact_uri: NotRequired[Literal["source/source.bin"]]
|
|
embedded_artifact_byte_length: NotRequired[SafeInteger]
|
|
|
|
|
|
class ManualSource(TypedDict):
|
|
kind: Literal["manual"]
|
|
source_id: LogicalId
|
|
|
|
|
|
class PresentationSource(TypedDict):
|
|
presentation_id: LogicalId
|
|
schema_version: Literal["1.0"]
|
|
artifact_hash: Hash
|
|
embedded_artifact_uri: NotRequired[Literal["presentation/presentation.json"]]
|
|
embedded_artifact_byte_length: NotRequired[SafeInteger]
|
|
|
|
|
|
class CoordinateSystem(TypedDict):
|
|
length_unit: Literal["mm"]
|
|
handedness: Literal["right"]
|
|
up_axis: Literal["+Z"]
|
|
|
|
|
|
class CompileOptions(TypedDict):
|
|
linear_tolerance: float
|
|
angular_tolerance: float
|
|
embed_source: bool
|
|
embed_presentation: bool
|
|
|
|
|
|
class ProductModelSource(TypedDict):
|
|
kind: Literal["product_model"]
|
|
root_id: LogicalId
|
|
semantic_type: Literal["Part", "Assembly"]
|
|
semantic_id: ProductId
|
|
graph_id: ProductId
|
|
node_id: ProductId
|
|
output_slot: SafeInteger
|
|
|
|
|
|
class ProductManualSource(TypedDict):
|
|
kind: Literal["product_manual"]
|
|
root_id: LogicalId
|
|
semantic_type: Literal["Part", "Assembly"]
|
|
semantic_id: ProductId
|
|
|
|
|
|
class ProductPackageDefinitionSource(TypedDict):
|
|
kind: Literal["product_package"]
|
|
root_id: LogicalId
|
|
semantic_type: Literal["Part", "Assembly"]
|
|
semantic_id: ProductId
|
|
package_kind: Literal["part_package", "assembly_package"]
|
|
package_revision: Hash
|
|
|
|
|
|
class ModelOutputSource(TypedDict):
|
|
kind: Literal["model_output"]
|
|
root_id: LogicalId
|
|
graph_id: ProductId
|
|
node_id: ProductId
|
|
output_slot: SafeInteger
|
|
|
|
|
|
class ImportedDefinitionSource(TypedDict):
|
|
kind: Literal["imported"]
|
|
root_id: LogicalId
|
|
source_element_id: str
|
|
|
|
|
|
class ManualDefinitionSource(TypedDict):
|
|
kind: Literal["manual"]
|
|
root_id: LogicalId
|
|
source_id: LogicalId
|
|
|
|
|
|
DefinitionSource = (
|
|
ProductModelSource
|
|
| ProductManualSource
|
|
| ProductPackageDefinitionSource
|
|
| ModelOutputSource
|
|
| ImportedDefinitionSource
|
|
| ManualDefinitionSource
|
|
)
|
|
|
|
|
|
class Definition(TypedDict):
|
|
definition_id: StructuralId
|
|
kind: Literal["part", "assembly", "shape"]
|
|
name: str | None
|
|
source: DefinitionSource
|
|
sdk_metadata: dict[str, Any]
|
|
geometry_asset_id: NotRequired[Hash]
|
|
edge_asset_id: NotRequired[Hash]
|
|
entity_asset_id: NotRequired[Hash]
|
|
appearance_id: NotRequired[StructuralId]
|
|
|
|
|
|
class ProductOccurrenceSource(TypedDict):
|
|
kind: Literal["product_occurrence"]
|
|
root_id: LogicalId
|
|
component_path: list[ProductId]
|
|
|
|
|
|
class ShapeRootSource(TypedDict):
|
|
kind: Literal["shape_root"]
|
|
root_id: LogicalId
|
|
|
|
|
|
class Node(TypedDict):
|
|
node_id: StructuralId
|
|
parent_node_id: StructuralId | None
|
|
order: SafeInteger
|
|
definition_id: StructuralId
|
|
name: str | None
|
|
transform: Transform
|
|
visible: bool
|
|
selectable: bool
|
|
appearance_override_id: StructuralId | None
|
|
source: ProductOccurrenceSource | ShapeRootSource
|
|
sdk_metadata: dict[str, Any]
|
|
|
|
|
|
class AssetBase(TypedDict):
|
|
asset_id: NotRequired[Hash]
|
|
uri: NotRequired[Uri]
|
|
media_type: NotRequired[Literal["model/gltf-binary"]]
|
|
byte_length: NotRequired[SafeInteger]
|
|
content_hash: NotRequired[Hash]
|
|
scene_local_bounds: NotRequired[Bounds]
|
|
asset_to_scene: NotRequired[
|
|
list[Literal[1000] | Literal[0] | Literal[-1000] | Literal[1]]
|
|
]
|
|
|
|
|
|
class Tessellation(TypedDict):
|
|
linear_tolerance: PositiveNumber
|
|
angular_tolerance: PositiveNumber
|
|
|
|
|
|
class GeometryAsset(TypedDict):
|
|
asset_id: Hash
|
|
uri: Uri
|
|
media_type: Literal["model/gltf-binary"]
|
|
byte_length: SafeInteger
|
|
content_hash: Hash
|
|
scene_local_bounds: Bounds
|
|
asset_to_scene: list[Literal[1000] | Literal[0] | Literal[-1000] | Literal[1]]
|
|
tessellation: Tessellation
|
|
|
|
|
|
class Tessellation1(TypedDict):
|
|
linear_tolerance: PositiveNumber
|
|
|
|
|
|
class EdgeAsset(TypedDict):
|
|
asset_id: Hash
|
|
uri: Uri
|
|
media_type: Literal["model/gltf-binary"]
|
|
byte_length: SafeInteger
|
|
content_hash: Hash
|
|
scene_local_bounds: Bounds
|
|
asset_to_scene: list[Literal[1000] | Literal[0] | Literal[-1000] | Literal[1]]
|
|
tessellation: Tessellation1
|
|
|
|
|
|
class EntityAsset(TypedDict):
|
|
entity_asset_id: Hash
|
|
uri: Uri
|
|
media_type: Literal["application/vnd.simplecad.entities+json"]
|
|
byte_length: SafeInteger
|
|
content_hash: Hash
|
|
|
|
|
|
class ProductMaterialSource(TypedDict):
|
|
kind: Literal["product_material"]
|
|
root_id: LogicalId
|
|
material_id: ProductId
|
|
|
|
|
|
class PresentationAppearanceSource(TypedDict):
|
|
kind: Literal["presentation"]
|
|
presentation_id: LogicalId
|
|
appearance_name: str
|
|
|
|
|
|
class Appearance(TypedDict):
|
|
appearance_id: str
|
|
name: str | None
|
|
source: ProductMaterialSource | PresentationAppearanceSource | None
|
|
base_color: Color
|
|
metallic: float
|
|
roughness: float
|
|
alpha_mode: Literal["opaque"]
|
|
double_sided: bool
|
|
edge_color: Color
|
|
sdk_metadata: dict[str, Any]
|
|
|
|
|
|
class ModelOperationSource(TypedDict):
|
|
kind: Literal["model_operation"]
|
|
graph_id: ProductId
|
|
node_id: ProductId
|
|
output_slot: SafeInteger
|
|
|
|
|
|
class ManualConnectorSource(TypedDict):
|
|
kind: Literal["manual"]
|
|
source_id: LogicalId
|
|
|
|
|
|
class ProductPackageConnectorSource(TypedDict):
|
|
kind: Literal["product_package"]
|
|
package_kind: Literal["part_package", "assembly_package"]
|
|
package_revision: Hash
|
|
definition_id: ProductId
|
|
|
|
|
|
class ConnectorTarget(TypedDict):
|
|
entity_asset_id: Hash
|
|
entity_id: str
|
|
|
|
|
|
class Connector(TypedDict):
|
|
connector_snapshot_id: StructuralId
|
|
owner_definition_id: StructuralId
|
|
connector_id: ProductId
|
|
name: str | None
|
|
anchor_kind: Literal["geometry", "placement", "public"]
|
|
local_transform: Transform
|
|
target: NotRequired[ConnectorTarget]
|
|
source_connector_snapshot_id: StructuralId | None
|
|
source: (
|
|
ModelOperationSource
|
|
| ManualConnectorSource
|
|
| ProductPackageConnectorSource
|
|
| None
|
|
)
|
|
sdk_metadata: dict[str, Any]
|
|
|
|
|
|
class CameraBase(TypedDict):
|
|
camera_id: NotRequired[StructuralId]
|
|
name: NotRequired[str]
|
|
parent_node_id: NotRequired[StructuralId | None]
|
|
transform: NotRequired[Transform]
|
|
near: NotRequired[PositiveNumber]
|
|
far: NotRequired[PositiveNumber]
|
|
|
|
|
|
class PerspectiveCamera(TypedDict):
|
|
camera_id: StructuralId
|
|
name: str
|
|
projection: Literal["perspective"]
|
|
parent_node_id: StructuralId | None
|
|
transform: Transform
|
|
near: PositiveNumber
|
|
far: PositiveNumber
|
|
vertical_fov_degrees: float
|
|
|
|
|
|
class OrthographicCamera(TypedDict):
|
|
camera_id: StructuralId
|
|
name: str
|
|
projection: Literal["orthographic"]
|
|
parent_node_id: StructuralId | None
|
|
transform: Transform
|
|
near: PositiveNumber
|
|
far: PositiveNumber
|
|
vertical_span: PositiveNumber
|
|
|
|
|
|
Camera = PerspectiveCamera | OrthographicCamera
|
|
|
|
|
|
class ModelSource(TypedDict):
|
|
kind: Literal["model"]
|
|
graph_id: ProductId
|
|
model_schema_version: Literal["2.0"]
|
|
artifact_hash: Hash
|
|
embedded_artifact_uri: NotRequired[Literal["model/model.json"]]
|
|
embedded_artifact_byte_length: NotRequired[SafeInteger]
|
|
source_files: NotRequired[list[SourceFile]]
|
|
|
|
|
|
SceneSource = ModelSource | ProductPackageSource | ImportedSource | ManualSource
|
|
|
|
|
|
class SceneDocument(TypedDict):
|
|
schema_version: Literal["1.0"]
|
|
extensions_used: list
|
|
extensions_required: list
|
|
extensions: dict[str, Any]
|
|
scene_id: LogicalId
|
|
revision: Hash
|
|
generator: Generator
|
|
source: SceneSource
|
|
presentation_source: NotRequired[PresentationSource]
|
|
coordinate_system: CoordinateSystem
|
|
compile_options: CompileOptions
|
|
definitions: list[Definition]
|
|
nodes: list[Node]
|
|
geometry_assets: list[GeometryAsset]
|
|
edge_assets: list[EdgeAsset]
|
|
appearances: list[Appearance]
|
|
entity_assets: list[EntityAsset]
|
|
connectors: list[Connector]
|
|
cameras: list[Camera]
|
|
lights: list
|
|
annotations: list
|
|
diagnostics: list
|