2023-11-29 10:32:31 -08:00
|
|
|
from typing import Literal, Union
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
from pydantic import BaseModel, ConfigDict, Field, RootModel
|
2023-11-29 10:32:31 -08:00
|
|
|
from typing_extensions import Annotated
|
2023-07-07 19:22:51 -07:00
|
|
|
|
|
|
|
from ..models.system import System
|
2023-07-31 12:50:30 -07:00
|
|
|
from ..models.unit_length import UnitLength
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
class fbx(BaseModel):
|
|
|
|
"""Autodesk Filmbox (FBX) format."""
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-11-29 10:32:31 -08:00
|
|
|
type: Literal["fbx"] = "fbx"
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
class gltf(BaseModel):
|
|
|
|
"""Binary glTF 2.0. We refer to this as glTF since that is how our customers refer to it, but this can also import binary glTF (glb)."""
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-29 10:32:31 -08:00
|
|
|
type: Literal["gltf"] = "gltf"
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
class obj(BaseModel):
|
|
|
|
"""Wavefront OBJ format."""
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
coords: System
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-29 10:32:31 -08:00
|
|
|
type: Literal["obj"] = "obj"
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
units: UnitLength
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
class ply(BaseModel):
|
|
|
|
"""The PLY Polygon File Format."""
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
coords: System
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-29 10:32:31 -08:00
|
|
|
type: Literal["ply"] = "ply"
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
units: UnitLength
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
class sldprt(BaseModel):
|
|
|
|
"""SolidWorks part (SLDPRT) format."""
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2023-11-29 10:32:31 -08:00
|
|
|
type: Literal["sldprt"] = "sldprt"
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
class step(BaseModel):
|
|
|
|
"""ISO 10303-21 (STEP) format."""
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-29 10:32:31 -08:00
|
|
|
type: Literal["step"] = "step"
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
class stl(BaseModel):
|
|
|
|
"""*ST**ereo**L**ithography format."""
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
coords: System
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2023-11-29 10:32:31 -08:00
|
|
|
type: Literal["stl"] = "stl"
|
2023-11-27 16:01:20 -08:00
|
|
|
|
2023-11-28 23:50:50 -08:00
|
|
|
units: UnitLength
|
2023-11-27 16:01:20 -08:00
|
|
|
|
2024-01-06 18:32:21 -08:00
|
|
|
model_config = ConfigDict(protected_namespaces=())
|
|
|
|
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-29 00:39:14 -08:00
|
|
|
InputFormat = RootModel[
|
2023-11-29 10:32:31 -08:00
|
|
|
Annotated[
|
|
|
|
Union[
|
|
|
|
fbx,
|
|
|
|
gltf,
|
|
|
|
obj,
|
|
|
|
ply,
|
|
|
|
sldprt,
|
|
|
|
step,
|
|
|
|
stl,
|
|
|
|
],
|
|
|
|
Field(discriminator="type"),
|
2023-11-28 14:29:16 -08:00
|
|
|
]
|
2023-11-29 00:39:14 -08:00
|
|
|
]
|